/* ==========================================================================
   Student Portal Premium Styles
   ========================================================================== */

/* Portal Base */
body.portal-page {
    background-color: var(--color-bg);
    color: var(--color-text);
    overflow-x: hidden;
}

.portal-main {
    padding-top: max(120px, 15vh);
    padding-bottom: 5rem;
    min-height: 80vh;
    position: relative;
    z-index: 1;
}

/* Background Effects */
.portal-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(circle at 50% 0%, rgba(20, 20, 25, 1) 0%, rgba(10, 10, 12, 1) 100%);
}

.portal-glow {
    position: absolute;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(160, 140, 255, 0.05) 0%, transparent 60%);
    top: -20%;
    left: -10%;
    border-radius: 50%;
    filter: blur(80px);
    animation: floatOrb 15s ease-in-out infinite alternate;
}

.portal-glow.secondary {
    top: auto;
    bottom: -10%;
    left: auto;
    right: -20%;
    background: radial-gradient(circle, rgba(100, 200, 255, 0.04) 0%, transparent 60%);
    animation-delay: -5s;
}

@keyframes floatOrb {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(5%, 5%) scale(1.1);
    }
}

/* Portal Header Area */
.portal-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.portal-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #ffffff, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.portal-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    max-width: 650px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

/* Feature Badges */
.feature-badges {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.feature-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(160, 140, 255, 0.1);
    color: #c0b3ff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(160, 140, 255, 0.2);
    backdrop-filter: blur(5px);
}

/* Stats Badges */
.resource-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.02);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.stat-item strong {
    color: var(--color-text);
    font-size: 1.1rem;
}

/* Search Bar */
.portal-search {
    max-width: 600px;
    margin: 0 auto 3rem;
    position: relative;
    z-index: 2;
}

.portal-search input {
    width: 100%;
    padding: 1.2rem 1.5rem 1.2rem 3rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.portal-search input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-accent);
    box-shadow: 0 0 20px rgba(160, 140, 255, 0.1);
}

.portal-search svg {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    width: 20px;
    height: 20px;
}

/* Featured Resource */
.featured-resource {
    max-width: 800px;
    margin: 0 auto 4rem;
    background: linear-gradient(135deg, rgba(160, 140, 255, 0.1) 0%, rgba(20, 20, 25, 0.8) 100%);
    border: 1px solid rgba(160, 140, 255, 0.2);
    border-radius: 16px;
    padding: 2.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.featured-label {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.featured-icon {
    font-size: 3rem;
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px rgba(160, 140, 255, 0.5));
}

.featured-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.featured-content p {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.featured-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-text);
    color: var(--color-bg);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

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

/* Glass Tabs System */
.portal-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.portal-tab-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-muted);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.portal-tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text);
}

.portal-tab-btn.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(160, 140, 255, 0.5);
    color: var(--color-text);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.portal-tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
    position: relative;
    z-index: 2;
}

.portal-tab-content.active {
    display: block;
}

/* Tab Headers */
.tab-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tab-header h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.tab-header p {
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Resource Grid */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.resource-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.resource-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.resource-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.resource-card:hover::before {
    transform: translateX(100%);
}

.resource-icon {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.resource-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-text);
}

.resource-desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Article specific metas */
.resource-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.article-author {
    font-weight: 500;
    color: #c0b3ff;
}

.resource-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease;
    margin-top: auto;
}

.resource-action:hover {
    color: var(--color-accent);
}

.resource-action svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.resource-action:hover svg {
    transform: translateX(4px);
}

/* Student ID Gating */
.gate-container {
    max-width: 500px;
    margin: 2rem auto 4rem;
    background: rgba(20, 20, 25, 0.6);
    border: 1px solid rgba(160, 140, 255, 0.2);
    padding: 3rem 2rem;
    border-radius: 16px;
    text-align: center;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.gate-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.5rem;
    color: #a08cff;
}

.gate-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-serif);
}

.gate-desc {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.features-list span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gate-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gate-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    text-align: center;
    letter-spacing: 2px;
}

.gate-input:focus {
    outline: none;
    border-color: rgba(160, 140, 255, 0.5);
    box-shadow: 0 0 10px rgba(160, 140, 255, 0.2);
}

.gate-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: normal;
}

.gate-btn {
    background: var(--color-text);
    color: var(--color-bg);
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.2s ease;
}

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

.gate-error {
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 1rem;
    display: none;
}

.gated-content {
    display: none;
}

/* Data Tables */
.portal-table-container {
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.portal-table th {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    font-weight: 500;
    color: var(--color-text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-table td {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.portal-table tr:last-child td {
    border-bottom: none;
}

.portal-table tr:hover td {
    background: rgba(255, 255, 255, 0.04);
}

.portal-table strong {
    color: var(--color-text);
    font-weight: 500;
}

.text-right {
    text-align: right;
}

.btn-download-small {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.2s ease;
}

.btn-download-small:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Student Reminder */
.student-reminder {
    margin-top: 5rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.student-reminder p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.reminder-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #a08cff;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.reminder-btn:hover {
    opacity: 0.8;
}

/* Auth modal overlay for email */
.email-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.email-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.email-modal {
    background: rgba(20, 20, 25, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2.5rem;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.email-modal-overlay.active .email-modal {
    transform: translateY(0);
}

.email-modal h3 {
    margin-bottom: 0.5rem;
}

.email-modal p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.email-modal input {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    margin-bottom: 1rem;
}

.email-modal button {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    background: var(--color-text);
    color: var(--color-bg);
    border: none;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1rem;
}

.email-modal-close {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    background: none;
    border: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

@media (max-width: 768px) {
    .featured-resource {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
    }
}