/* Xmmersia Portal - Shared Gaudí-Inspired Styles */

:root {
    /* Nature palette - forest canopy */
    --sage: #87A878;
    --sage-light: #A8C69F;
    --moss: #5D7052;
    --forest: #3D4F35;
    --cream: #F5F2EB;
    --gold: #D4A853;
    --gold-light: #E8C97A;
    --bark: #4A3C31;
    
    /* Hub colors */
    --hub-green: #4a7c59;
    --mate-blue: #4a6fa5;
    
    /* Functional colors */
    --text-primary: #2C3E2D;
    --text-secondary: #5A6B5C;
    --shadow-soft: rgba(61, 79, 53, 0.1);
    --shadow-medium: rgba(61, 79, 53, 0.2);
    
    /* Animation */
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, var(--cream) 0%, #E8E4DB 50%, #DDD8CC 100%);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ─────────────────────────────────────────────────────────────────
   Floating Particles
   ───────────────────────────────────────────────────────────────── */

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0.4;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* ─────────────────────────────────────────────────────────────────
   Canopy Background
   ───────────────────────────────────────────────────────────────── */

.canopy {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(135, 168, 120, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(168, 198, 159, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(93, 112, 82, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: canopySway 20s infinite ease-in-out;
}

@keyframes canopySway {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.02) rotate(0.5deg); }
}

/* ─────────────────────────────────────────────────────────────────
   Portal Container & Layout
   ───────────────────────────────────────────────────────────────── */

.portal-container {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.portal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

/* ─────────────────────────────────────────────────────────────────
   Header & Navigation
   ───────────────────────────────────────────────────────────────── */

.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    position: relative;
    z-index: 10;
    /* No background - logo floats naturally on the page */
}

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
}

.logo-icon {
    height: 90px;
    width: auto;
}

.header-tagline {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: var(--sage);
    font-size: 1rem;
}

/* Hub Navigation */
.hub-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-hub {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid transparent;
}

.nav-hub:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--sage-light);
    transform: translateY(-2px);
}

.nav-hub.active {
    background: var(--hub-green);
    color: white;
    border-color: var(--hub-green);
}

.nav-icon {
    font-size: 1rem;
}

.nav-label {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* User Section */
.user-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-id {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.logout-btn {
    background: none;
    border: 1px solid var(--sage);
    color: var(--sage);
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.logout-btn:hover {
    background: var(--sage);
    color: white;
}

/* ─────────────────────────────────────────────────────────────────
   Footer
   ───────────────────────────────────────────────────────────────── */

.portal-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ─────────────────────────────────────────────────────────────────
   Login Page Styles
   ───────────────────────────────────────────────────────────────── */

.login-page {
    justify-content: center;
    padding: 2rem;
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    width: 100%;
    max-width: 550px;
}

.login-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    padding: 3.5rem 3rem;
    background: linear-gradient(145deg, #FDFCF9 0%, #F8F6F0 100%);
    backdrop-filter: blur(15px);
    /* Subtle organic shape - like a smooth river stone */
    border-radius: 40px 50px 45px 55px / 50px 45px 55px 40px;
    box-shadow: 
        0 20px 60px rgba(61, 79, 53, 0.12),
        0 8px 25px rgba(61, 79, 53, 0.08);
    text-align: center;
    border: 1px solid rgba(135, 168, 120, 0.12);
    transition: var(--transition-smooth);
}

.login-card:hover {
    transform: translateY(-5px);
    border-radius: 50px 40px 55px 45px / 45px 55px 40px 50px;
    box-shadow: 
        0 30px 80px rgba(61, 79, 53, 0.15),
        0 15px 40px rgba(61, 79, 53, 0.1);
}

.login-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--gold-light) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0.15;
    pointer-events: none;
}

.login-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.75rem;
    font-weight: 600;
    color: var(--forest);
    margin-bottom: 0.5rem;
    white-space: nowrap;
}

.login-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.input-group {
    position: relative;
    margin-bottom: 1rem;
}

.input-group input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3rem;
    border: 2px solid #E5E5E5;
    border-radius: 25px 25px 20px 30px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.9);
}

.input-group input:focus {
    outline: none;
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(135, 168, 120, 0.2);
    border-radius: 30px 20px 25px 25px;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
}

.login-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--sage) 0%, var(--moss) 100%);
    color: white;
    border: none;
    border-radius: 40% 60% 60% 40% / 60% 40% 40% 60%;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-bounce);
    box-shadow: 0 4px 15px rgba(93, 112, 82, 0.3);
}

.login-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(93, 112, 82, 0.4);
    border-radius: 60% 40% 40% 60% / 40% 60% 60% 40%;
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.login-error {
    color: #c0392b;
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fdeaea;
    border-radius: 8px;
}

.sent-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.sent-email {
    font-weight: 600;
    color: var(--forest);
    font-size: 1.1rem;
    margin: 0.5rem 0 1.5rem;
}

.expiry-notice {
    background: #d4edda;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.expiry-label {
    display: block;
    font-size: 0.85rem;
    color: #155724;
}

.expiry-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #155724;
}

.secondary-btn {
    background: rgba(135, 168, 120, 0.1);
    color: var(--moss);
    border: 2px solid var(--sage);
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.secondary-btn:hover {
    background: var(--sage);
    color: white;
}

/* Hub Preview */
.hub-preview {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.hub-preview-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 2rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 40% 60% 50% 50% / 50% 50% 60% 40%;
    border: 1px solid rgba(135, 168, 120, 0.2);
    transition: var(--transition-smooth);
}

.hub-preview-card:hover {
    transform: translateY(-5px) rotate(-2deg);
    box-shadow: 0 15px 40px var(--shadow-soft);
    border-radius: 50% 50% 40% 60% / 60% 40% 50% 50%;
}

.hub-preview-card:nth-child(2) {
    border-radius: 50% 50% 60% 40% / 40% 60% 50% 50%;
}

.hub-preview-card:nth-child(2):hover {
    transform: translateY(-5px) rotate(2deg);
    border-radius: 60% 40% 50% 50% / 50% 50% 40% 60%;
}

.preview-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.preview-name {
    font-weight: 600;
    color: var(--hub-green);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.preview-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ─────────────────────────────────────────────────────────────────
   Modal Styles
   ───────────────────────────────────────────────────────────────── */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(61, 79, 53, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    padding: 2.5rem;
    border-radius: 25px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
    transform: translateY(20px) scale(0.95);
    transition: var(--transition-bounce);
    max-height: 90vh;
    overflow-y: auto;
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
    line-height: 1;
}

.modal-close:hover {
    color: var(--forest);
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.modal-content h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    color: var(--forest);
    margin-bottom: 0.75rem;
}

.modal-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.modal-submit {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--bark);
    border: none;
    border-radius: 25px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-bounce);
    box-shadow: 0 4px 15px rgba(212, 168, 83, 0.3);
}

.modal-submit:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(212, 168, 83, 0.4);
}

.modal-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.modal-note {
    font-size: 0.85rem !important;
    color: var(--text-secondary) !important;
    margin-top: 1rem !important;
    margin-bottom: 0 !important;
}

.modal-error {
    color: #c0392b;
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fdeaea;
    border-radius: 8px;
}

/* Options List */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--cream);
    border: 2px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: left;
    font-family: 'Outfit', sans-serif;
}

.option-btn:hover {
    border-color: var(--sage);
    background: white;
    transform: translateX(5px);
}

.option-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.option-btn:disabled:hover {
    border-color: transparent;
    background: var(--cream);
    transform: none;
}

.option-icon {
    font-size: 1.5rem;
}

.option-text {
    display: flex;
    flex-direction: column;
}

.option-label {
    font-weight: 500;
    color: var(--forest);
    font-size: 1rem;
}

.option-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Loading Spinner */
.loading-spinner {
    animation: spin 1s linear infinite;
}

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

/* ─────────────────────────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .portal-header {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1rem;
    }
    
    .hub-nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .nav-hub {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .nav-label {
        display: none;
    }
    
    .login-title {
        font-size: 2rem;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
    }
    
    .hub-preview {
        flex-direction: column;
    }
}

/* ─────────────────────────────────────────────────────────────────
   View As Toggle Button (Staff only)
   ───────────────────────────────────────────────────────────────── */
.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(78, 115, 62, 0.3);
    border-radius: 20px;
    color: #4E733E;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.view-toggle-btn:hover {
    background: rgba(78, 115, 62, 0.1);
    border-color: rgba(78, 115, 62, 0.5);
    transform: translateY(-1px);
}

.view-toggle-btn:active {
    transform: translateY(0);
}

.view-toggle-btn .toggle-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.view-toggle-btn .toggle-label {
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .view-toggle-btn .toggle-label {
        display: none;
    }
    
    .view-toggle-btn {
        padding: 0.5rem 0.75rem;
    }
}

/* ─────────────────────────────────────────────────────────────────
   Info Icons (Panel Help)
   ───────────────────────────────────────────────────────────────── */

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 8px;
    padding: 0;
    background: rgba(135, 168, 120, 0.15);
    border: 1px solid rgba(135, 168, 120, 0.3);
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition-smooth);
    vertical-align: middle;
    opacity: 0.7;
}

.info-icon:hover {
    background: rgba(135, 168, 120, 0.3);
    border-color: var(--sage);
    opacity: 1;
    transform: scale(1.1);
}

.info-icon:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(135, 168, 120, 0.4);
}

/* Panel title with info icon */
.panel-title {
    display: flex;
    align-items: center;
}

/* Info Modal specific styles */
.info-modal-content {
    text-align: left;
}

.info-modal-content h2 {
    text-align: center;
}

.info-modal-content .modal-icon {
    text-align: center;
    display: block;
}

.info-modal-content .info-modal-close {
    margin-top: 1.5rem;
}

.info-modal-content ul {
    margin: 0.5rem 0 1rem 1.25rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.info-modal-content li {
    margin-bottom: 0.4rem;
}

.info-modal-content strong {
    color: var(--forest);
}

.info-modal-content .info-highlight {
    background: rgba(135, 168, 120, 0.1);
    border-left: 3px solid var(--sage);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
}

.info-modal-content .info-color-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 0.75rem 0;
}

.info-modal-content .color-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.info-modal-content .color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.info-modal-content .color-dot.green {
    background: #4CAF50;
}

.info-modal-content .color-dot.yellow {
    background: #FF9800;
}

.info-modal-content .color-dot.red {
    background: #f44336;
}


/* ─────────────────────────────────────────────────────────────────
   Onboarding Form Styles (v3.7.0)
   ───────────────────────────────────────────────────────────────── */

.onboarding-form {
    text-align: left;
    margin: 1.5rem 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--forest);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0ddd5;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(135, 168, 120, 0.15);
}

.form-group input[type="text"]::placeholder {
    color: #aaa;
}

/* Course Selection Radio Buttons */
.course-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.course-option {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--cream);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.course-option:hover {
    background: #EBE8E1;
}

.course-option:has(input:checked) {
    background: rgba(135, 168, 120, 0.15);
    border-color: var(--sage);
}

.course-option input[type="radio"] {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    accent-color: var(--sage);
    cursor: pointer;
}

.course-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.course-option:has(input:checked) .course-label {
    font-weight: 600;
    color: var(--forest);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    font-style: italic;
    line-height: 1.5;
}

/* ─────────────────────────────────────────────────────────────────
   Dashboard Search Styles (v4.9.0)
   ───────────────────────────────────────────────────────────────── */

.selector-search {
    position: relative;
    margin-bottom: 0.75rem;
}

.student-search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid #e0ddd5;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.student-search-input:focus {
    outline: none;
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(135, 168, 120, 0.15);
}

.student-search-input::placeholder {
    color: #aaa;
}

.selector-search .search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    font-size: 1rem;
    pointer-events: none;
}

/* Search results hint */
.selector-hint.filtered {
    color: var(--sage);
    font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────────
   Responsive Adjustments
   ───────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .course-options {
        gap: 0.4rem;
    }
    
    .course-option {
        padding: 0.6rem 0.75rem;
    }
}

