/**
 * RC Flight Replay - Authentication UI Styles
 */

/* Login Modal */
#loginModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

#loginModalContent {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 40px;
    max-width: 420px;
    width: 90%;
    color: white;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#loginModal h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
}

#loginModal .subtitle {
    text-align: center;
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 30px;
}

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

#loginModal label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.95;
}

#loginModal input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

#loginModal input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
}

#loginModal input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#loginModal button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

#loginButton {
    background: white;
    color: #667eea;
}

#loginButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#loginButton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#cancelLoginButton {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    margin-top: 10px;
}

#cancelLoginButton:hover {
    background: rgba(255, 255, 255, 0.25);
}

#loginError {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

#loginLoading {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    opacity: 0.9;
    display: none;
}

/* User Panel */
#userPanel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 380px;
    max-height: calc(100vh - 120px);
    background: rgba(30, 30, 40, 0.95);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    color: white;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    z-index: 1000;
    display: none;
    animation: panelSlideIn 0.3s ease-out;
}

@keyframes panelSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#userPanel.visible {
    display: flex;
    flex-direction: column;
}

.user-panel-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    position: relative;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.subscription-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.subscription-badge i {
    font-size: 12px;
    color: #b8860b;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.user-member-since {
    font-size: 12px;
    opacity: 0.9;
}

.close-user-panel {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.close-user-panel:hover {
    background: rgba(255, 255, 255, 0.25);
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
}

.user-stat {
    text-align: center;
}

.user-stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-stat-label {
    font-size: 11px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.user-panel-section {
    margin-bottom: 24px;
}

.user-panel-section h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

.flights-by-model {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.model-group {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.model-header {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.model-header:hover {
    background: rgba(255, 255, 255, 0.1);
}

.model-icon {
    font-size: 24px;
}

.model-info {
    flex: 1;
}

.model-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 3px;
}

.model-flight-count {
    font-size: 12px;
    opacity: 0.7;
}

.model-chevron {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.model-group.expanded .model-chevron {
    transform: rotate(90deg);
}

.model-flights {
    display: none;
    padding: 8px;
}

.model-group.expanded .model-flights {
    display: block;
}

.flight-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.flight-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateX(4px);
}

.flight-date {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.flight-details {
    display: flex;
    gap: 12px;
    font-size: 11px;
    opacity: 0.7;
}

.flight-detail {
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-panel-footer {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#logoutButton {
    width: 100%;
    padding: 12px;
    background: rgba(244, 67, 54, 0.2);
    color: white;
    border: 1px solid rgba(244, 67, 54, 0.5);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#logoutButton:hover {
    background: rgba(244, 67, 54, 0.3);
    transform: translateY(-2px);
}

/* Login Button in Header */
#userLoginButton {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#userLoginButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

#userLoginButton.logged-in {
    background: rgba(76, 175, 80, 0.9);
}

/* Responsive Design */
@media (max-width: 768px) {
    #userPanel {
        width: calc(100% - 40px);
        right: 20px;
        top: 70px;
    }

    #loginModalContent {
        padding: 30px 20px;
    }
}

/* Scrollbar styling */
.user-panel-content::-webkit-scrollbar {
    width: 8px;
}

.user-panel-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.user-panel-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.user-panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Add Model Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    color: white;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.modal-content h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
}

.modal-content .subtitle {
    text-align: center;
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 30px;
}

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

.modal-content label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.95;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    font-family: inherit;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
}

.modal-content input::placeholder,
.modal-content textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.modal-content select option {
    background: #764ba2;
    color: white;
}

.modal-content textarea {
    min-height: 80px;
    resize: vertical;
}

.modal-content .field-error {
    color: #ffcccc;
    font-size: 12px;
    margin-top: 6px;
    display: block;
}

.modal-content input.error,
.modal-content select.error,
.modal-content textarea.error {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.2);
}

.modal-content .error-container {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.modal-content .error-container.visible {
    display: block;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.modal-buttons button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-buttons button[type="submit"] {
    background: white;
    color: #667eea;
}

.modal-buttons button[type="submit"]:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.modal-buttons button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modal-buttons button[type="button"] {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.modal-buttons button[type="button"]:hover {
    background: rgba(255, 255, 255, 0.25);
}

.collapsible-section {
    margin: 20px 0;
}

.collapsible-toggle {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.collapsible-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

.collapsible-toggle i {
    transition: transform 0.3s ease;
}

.collapsible-toggle.active i {
    transform: rotate(180deg);
}

.collapsible-content {
    display: none;
    padding-top: 20px;
}

.collapsible-content.visible {
    display: block;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10001;
    animation: slideIn 0.3s ease-out;
}

.toast-notification i {
    font-size: 20px;
}

.toast-notification.error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Modal Scrollbar */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 30px 20px;
        max-height: 95vh;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .toast-notification {
        bottom: 20px;
        right: 20px;
        left: 20px;
    }
}
