/* ============================================
   DOBIO APP - Authentication & Player Styles
   Extends the shared styles.css design system
   ============================================ */

/* --- AUTH PAGE LAYOUT --- */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1e293b 100%);
}

.auth-page main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* --- AUTH CARD --- */
.auth-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: cardSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes cardSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card .logo-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card .logo-header img {
    height: 56px;
    margin-bottom: 0.75rem;
}

.auth-card .logo-header h1 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.auth-card .logo-header p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
}

/* --- FORM ELEMENTS --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: #f8fafc;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-group input::placeholder {
    color: #94a3b8;
}

/* --- AUTH BUTTONS --- */
.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.auth-actions .btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-family: inherit;
}

.btn-login {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-login:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-register {
    background: transparent;
    color: var(--primary);
    border: 2px solid #e2e8f0;
}

.btn-register:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-login:disabled,
.btn-register:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* --- STATUS MESSAGE --- */
.status-message {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    margin-top: 1rem;
    display: none;
    animation: fadeIn 0.3s ease;
}

.status-message.visible {
    display: block;
}

.status-message.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.status-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-message.loading {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

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

/* --- LICENSE PAGE --- */
.license-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--light);
}

.license-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.license-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.license-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.license-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.license-info-row:last-child {
    border-bottom: none;
}

.license-info-row .label {
    color: var(--text-light);
    font-size: 0.95rem;
}

.license-info-row .value {
    font-weight: 600;
    font-size: 1rem;
}

.license-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.license-badge.active {
    background: #ecfdf5;
    color: #065f46;
}

.license-badge.expired {
    background: #fef2f2;
    color: #991b1b;
}

.license-actions {
    margin-top: 1.5rem;
}

.license-actions .btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* --- APP NAV BAR --- */
.app-nav {
    background: white;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 48px;
}

.app-nav .nav-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.app-nav .nav-left .logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.app-nav .nav-left .logo img {
    height: 28px;
}

.app-nav .nav-links {
    display: flex;
    gap: 4px;
}

.app-nav .nav-links a {
    color: var(--text-light);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.app-nav .nav-links a:hover,
.app-nav .nav-links a.active {
    color: var(--primary);
    background: var(--light);
}

.app-nav .nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-nav .user-info {
    color: var(--text-light);
    font-size: 0.9rem;
    display: none; /* User info hidden via CSS */
}

.btn-logout, .btn-fullscreen {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: var(--text-light);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-logout:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.btn-fullscreen:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

/* --- WEBGL PLAYER PAGE --- */
.player-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #0f172a;
    overflow: hidden;
}

.player-container {
    flex: 1;
    display: flex;
    padding: 0; /* Remove padding for edge-to-edge */
    height: calc(100vh - 48px);
}

#unity-container {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 0; /* Edge to edge */
    overflow: hidden;
}

#unity-canvas {
    width: 100%;
    height: 100%;
    display: block;
    background: #1e293b;
}

/* --- LOADING OVERLAY --- */
.unity-loading-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1e3a5f, #0f172a);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.5s ease;
}

.unity-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1.5rem;
}

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

.unity-loading-overlay .loading-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-weight: 500;
}

.unity-loading-overlay .loading-progress {
    margin-top: 1rem;
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.unity-loading-overlay .loading-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

/* --- PLAYER NAV (dark variant) --- */
.player-page .app-nav {
    background: #1e293b;
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.player-page .app-nav .nav-left .logo {
    color: white;
}

.player-page .app-nav .nav-links a {
    color: rgba(255, 255, 255, 0.6);
}

.player-page .app-nav .nav-links a:hover,
.player-page .app-nav .nav-links a.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.player-page .app-nav .user-info {
    color: rgba(255, 255, 255, 0.5);
}

.player-page .btn-logout {
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
}

.player-page .btn-logout:hover {
    background: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.4);
    color: #fca5a5;
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    .auth-card {
        padding: 1.75rem;
        margin: 1rem;
    }

    .app-nav .nav-links {
        display: none;
    }

    .app-nav .user-info {
        display: none;
    }

    .license-container {
        padding: 1rem;
    }

    .license-card {
        padding: 1.5rem;
    }

    #unity-container {
        border-radius: 0;
    }

    .player-container {
        padding: 0;
    }
}

/* --- BACKGROUND PARTICLES (login page decoration) --- */
.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(30, 58, 95, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

.auth-page main {
    position: relative;
    z-index: 1;
}

/* --- FOOTER (app variant) --- */
.app-footer {
    background: var(--primary);
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
}

.app-footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.app-footer a:hover {
    color: white;
}
