/**
 * CSC-TMS Landing Page Styles
 * Extracted from index.php
 */

:root {
    --primary-color: #0077b6;
    --primary-dark: #023e8a;
    --primary-light: #48cae4;
    --accent-gold: #f5a623;
    --text-dark: #1a1a1a;
    --text-light: #4a5568;
    --bg-light: #f7fafc;
}

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

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* ========================================
   PREMIUM PRELOADER STYLES
   ======================================== */

/* Preloader Container - Full viewport overlay */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

/* Fade out animation when loaded */
#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Animated background particles for visual depth */
#preloader::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(72, 202, 228, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -30px); }
    66% { transform: translate(-20px, 20px); }
}

/* Main loader container */
.preloader-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* Outer spinning ring - Modern orbital animation */
.loader-ring {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Multiple concentric rings for depth */
.loader-ring::before,
.loader-ring::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: spin 2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

/* Outer ring - gradient border */
.loader-ring::before {
    width: 100%;
    height: 100%;
    border-top-color: rgba(255, 255, 255, 0.9);
    border-right-color: rgba(255, 255, 255, 0.6);
    border-bottom-color: rgba(255, 255, 255, 0.3);
    animation-duration: 2s;
}

/* Inner ring - reversed animation for dynamic effect */
.loader-ring::after {
    width: 85%;
    height: 85%;
    border-top-color: rgba(245, 166, 35, 0.8);
    border-left-color: rgba(245, 166, 35, 0.4);
    animation-direction: reverse;
    animation-duration: 1.5s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pulsing circle behind logo for glow effect */
.loader-pulse {
    position: absolute;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.15);
        opacity: 0.7;
    }
}

/* Logo container - centered within loader */
.loader-logo {
    position: relative;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: fadeInScale 0.6s ease-out;
    z-index: 1.5;
}

/* Logo image styling */
.loader-logo img {
    width: 80px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Loading text beneath loader */
.loader-text {
    margin-top: 30px;
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: fadeIn 1s ease-out 0.3s both;
}

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

/* Animated dots after loading text */
.loader-dots {
    display: inline-block;
    width: 20px;
}

.loader-dots span {
    animation: dotPulse 1.4s ease-in-out infinite;
    display: inline-block;
}

.loader-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 60%, 100% { opacity: 0; }
    30% { opacity: 1; }
}

/* Progress bar beneath text */
.loader-progress {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
    animation: fadeIn 1s ease-out 0.5s both;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, white, var(--accent-gold));
    border-radius: 2px;
    animation: progressAnimation 2s ease-in-out infinite;
}

@keyframes progressAnimation {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Accessibility: Hidden label for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   MAIN CONTENT STYLES
   ======================================== */

/* Initially hide main content until loaded */
#main-content {
    opacity: 0;
    transition: opacity 0.6s ease-in;
}

#main-content.loaded {
    opacity: 1;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(0, 77, 112, 0.95), rgba(11, 111, 165, 0.95), rgba(49, 126, 214, 0.92));
    position: relative;
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    /* NOTE: URL updated to relative path for CSS folder structure */
    background: url('../../img/cscbglogin.jpg') no-repeat center center / cover;
    opacity: 0.15;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    color: white;
}

.logo-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    transition: transform 0.1s ease;
}

.logo-group img {
    height: 100px;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.logo-group img:hover {
    transform: translateY(-5px);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-description {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary-custom {
    background: white;
    color: var(--primary-color);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border: 2px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary-custom:hover {
    background: transparent;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-outline-custom {
    background: transparent;
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border: 2px solid white;
}

.btn-outline-custom:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* Features Section */
.features-section {
    padding: 6rem 0;
    background: #f8f9fa;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    text-align: center;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 4rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.feature-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 119, 182, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid rgba(0, 119, 182, 0.1);
    border-left: 4px solid var(--primary-color);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 30px rgba(0, 119, 182, 0.2);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.feature-icon i {
    font-size: 2rem;
    color: white;
}

.feature-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.feature-description {
    color: var(--text-light);
    line-height: 1.7;
}

/* About Section */
.about-section {
    padding: 6rem 0;
    background: white;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.about-text strong {
    color: var(--primary-dark);
}

.about-image-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 119, 182, 0.2);
    transition: all 0.4s ease;
}

.about-image-container:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 50px rgba(0, 119, 182, 0.3);
}

.about-image-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 119, 182, 0.1), rgba(72, 202, 228, 0.1));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.about-image-container:hover::before {
    opacity: 1;
}

.about-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.about-image-container:hover .about-image {
    transform: scale(1.05);
}

/* CTA Section */
.cta-section {
    background: var(--primary-dark);
    color: white;
    padding: 5rem 0;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
}

.btn-cta {
    background: white;
    color: var(--primary-dark);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    border: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(255,255,255,0.3);
    color: var(--primary-dark);
}

/* Footer */
.footer {
    background: #1a1a1a;
    color: white;
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.footer-section p,
.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    line-height: 1.7;
    display: block;
    margin-bottom: 0.5rem;
}

.footer-section a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-bottom a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

.footer-bottom a:hover {
    color: var(--primary-light);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .loader-ring {
        width: 160px;
        height: 160px;
    }

    .loader-logo {
        width: 100px;
        height: 100px;
    }

    .loader-logo img {
        width: 65px;
    }

    .loader-text {
        font-size: 0.95rem;
    }

    .loader-progress {
        width: 160px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .logo-group img {
        height: 70px;
    }

    .section-title {
        font-size: 2rem;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .btn-primary-custom,
    .btn-outline-custom {
        width: 100%;
        justify-content: center;
    }

    .feature-card {
        padding: 2rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-image-container {
        margin-top: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .loader-ring {
        width: 140px;
        height: 140px;
    }

    .loader-logo {
        width: 85px;
        height: 85px;
    }

    .loader-logo img {
        width: 55px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .logo-group {
        gap: 1rem;
    }

    .logo-group img {
        height: 60px;
    }
}

/* Reduce motion for users who prefer it (Accessibility) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}