/**
 * App Components Styles
 * Extracted from Renderer.php
 *
 * CSS Variables expected:
 * --primary: Primary theme color
 * --primary-light: Light primary color (with alpha)
 */

/* ===== App Footer ===== */
.app-footer {
    padding: 2px 0;
}

.app-footer .footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.app-footer .footer-share {
    flex: 0 0 auto;
}

.app-footer .footer-share .share-label,
.app-footer .footer-share .share-buttons {
    color: white;
}

.app-footer .footer-rights {
    flex: 1;
    text-align: center;
}

.app-footer .footer-rights p,
.app-footer .footer-rights,
.app-footer .footer-rights * {
    margin: 0;
    color: white;
    font-size: 14px;
}

.app-footer .footer-rights a {
    color: white;
    text-decoration: underline;
}

.app-footer .footer-spacer {
    flex: 0 0 auto;
    width: 150px;
}

/* ===== Profile Page ===== */
.profile-container {
    max-width: 700px;
    margin: 0 auto;
}

.profile-message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-message.success {
    background: #d4edda;
    color: #155724;
}

.profile-message.error {
    background: #f8d7da;
    color: #721c24;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    background: linear-gradient(135deg, var(--primary-light, rgba(102, 126, 234, 0.15)), var(--primary-lighter, rgba(102, 126, 234, 0.05)));
    border-radius: 16px;
    margin-bottom: 30px;
}

.profile-avatar-wrapper {
    position: relative;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: var(--primary, #667eea);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 40px;
    overflow: hidden;
}

.profile-avatar.has-photo {
    background: #e9ecef;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-photo-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    background: var(--primary, #667eea);
    color: white;
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.profile-photo-btn:hover {
    transform: scale(1.1);
}

.profile-info h2 {
    margin: 0 0 5px;
}

.profile-info p {
    margin: 0;
    color: #666;
}

.profile-member {
    font-size: 12px;
    color: #999;
}

.profile-section {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.profile-section h3 {
    margin: 0 0 20px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
}

.profile-section h3 i {
    color: var(--primary, #667eea);
}

.profile-field {
    margin-bottom: 20px;
}

.profile-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.profile-field .required {
    color: #dc3545;
}

.profile-field .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    box-sizing: border-box;
}

.profile-field .form-control:focus {
    outline: none;
    border-color: var(--primary, #667eea);
}

.profile-field .form-control:disabled {
    background: #f5f5f5;
    color: #999;
}

.profile-field small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

.btn-profile-save {
    padding: 14px 30px;
    background: var(--primary, #667eea);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-profile-save:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-profile-save.secondary {
    background: #6c757d;
}

/* ===== Photo Modal ===== */
.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.photo-modal.active {
    display: flex;
}

.photo-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    overflow: hidden;
}

.photo-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.photo-modal-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.photo-modal-header h3 i {
    color: var(--primary, #667eea);
}

.photo-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.photo-modal-body {
    padding: 20px;
}

.photo-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.photo-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px 20px;
    border: 2px dashed #ddd;
    border-radius: 12px;
    cursor: pointer;
    background: #f8f9fa;
    transition: all 0.3s;
}

.photo-option:hover {
    border-color: var(--primary, #667eea);
    background: var(--primary-light, rgba(102, 126, 234, 0.1));
}

.photo-option i {
    font-size: 32px;
    color: var(--primary, #667eea);
}

.photo-option span {
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.photo-option input[type="file"] {
    display: none;
}

.photo-remove {
    margin-top: 20px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn-remove-photo {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-remove-photo:hover {
    text-decoration: underline;
}

/* Camera */
#camera-video {
    width: 100%;
    border-radius: 12px;
    background: #000;
}

.camera-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.btn-photo {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary, #667eea);
    color: white;
}

.btn-photo.secondary {
    background: #6c757d;
}

.btn-photo:hover {
    opacity: 0.9;
}

/* ===== Gallery Lightbox ===== */
.gallery-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox.active {
    display: flex;
}

.gallery-lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.gallery-lightbox-btn {
    position: absolute;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

.gallery-lightbox-prev,
.gallery-lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
}

.gallery-lightbox-prev {
    left: 20px;
}

.gallery-lightbox-next {
    right: 20px;
}

.gallery-lightbox-close {
    top: 20px;
    right: 20px;
    font-size: 30px;
}

.gallery-item {
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    border-radius: 8px;
    transition: transform 0.2s;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

/* ===== Login Required ===== */
.login-required {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.login-required i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
    display: block;
}

.login-required h3 {
    margin-bottom: 10px;
}

.login-required p {
    color: #666;
    margin-bottom: 20px;
}

/* ===== Alerts ===== */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #e7f3ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.alert i {
    font-size: 18px;
}

/* ===== Data Manager ===== */
.data-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.data-manager-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.data-form-container {
    max-width: 600px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.data-form .form-group {
    margin-bottom: 20px;
}

.data-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.data-form .form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.data-form .form-control:focus {
    border-color: var(--primary, #667eea);
    outline: none;
}

.data-form .form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.data-table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: #666;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table .actions {
    white-space: nowrap;
}

.data-table .actions form {
    display: inline;
    margin-left: 5px;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px;
    background: white;
    border-radius: 12px;
}

.empty-state i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
    display: block;
}

/* ===== Common Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary, #667eea);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-outline {
    background: transparent;
    border: 2px solid #ddd;
    color: #333;
}

.btn-outline:hover {
    border-color: #bbb;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 14px;
}

/* ===== Accordion ===== */
.accordion-header {
    cursor: pointer;
}

.accordion-item:not(.active) .accordion-content {
    display: none;
}

/* ===== Notification Bell ===== */
.nav-notify-menu { list-style: none !important; }
.notify-wrapper { position: relative; display: flex; align-items: center; }
.notify-btn {
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 8px !important;
    font-size: 22px !important;
    color: inherit !important;
    position: relative;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    transition: background 0.2s;
}
.notify-btn:hover { background: rgba(0,0,0,0.05) !important; }
.notify-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #dc3545;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 10px;
    padding: 0 4px;
    pointer-events: none;
}
.notify-badge:empty { display: none; }

.notify-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    max-height: 440px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 1100;
    overflow: hidden;
    flex-direction: column;
}
.notify-panel.show { display: flex; }

.notify-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.notify-panel-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}
.notify-mark-all {
    background: none;
    border: none;
    color: var(--primary, #667eea);
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    padding: 0;
}
.notify-mark-all:hover { text-decoration: underline; }

.notify-panel-list {
    overflow-y: auto;
    flex: 1;
    max-height: 380px;
}
.notify-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}
.notify-item:hover { background: #f8f9fa; }
.notify-item.unread { background: #eef4ff; }
.notify-item.unread:hover { background: #e3ecfc; }

.notify-item-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    background: var(--primary, #667eea);
}
.notify-item-icon.type-message { background: #0d6efd; }
.notify-item-icon.type-alert { background: #dc3545; }
.notify-item-icon.type-update { background: #198754; }
.notify-item-icon.type-general { background: #6c757d; }

.notify-item-body { flex: 1; min-width: 0; }
.notify-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notify-item-msg {
    font-size: 12px;
    color: #666;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notify-item-time {
    font-size: 11px;
    color: #999;
}

.notify-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}
.notify-empty i {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
    color: #ccc;
}
.notify-empty p {
    margin: 0;
    font-size: 13px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .photo-options {
        grid-template-columns: 1fr;
    }

    .data-manager-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .app-footer .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .app-footer .footer-spacer {
        display: none;
    }

    .notify-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
    }
    .notify-panel.show {
        animation: slideUpNotify 0.3s ease;
    }
    @keyframes slideUpNotify {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
}
