/* ============================================
   TeraSoft - Education Affiliation Platform
   Modern Black Theme with Premium Design
   ============================================ */

/* Base Styles */
:root {
    --primary-color: #00d4ff;
    --secondary-color: #ffd700;
    --dark-bg: #0a0a0a;
    --darker-bg: #000000;
    --card-bg: #1a1a1a;
    --text-light: #ffffff;
    --text-muted: #b0b0b0;
    --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    --gradient-secondary: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
}

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

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: 'Roboto', sans-serif;
    background: var(--dark-bg);
    color: var(--text-light);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Global dark-theme readability fixes
   Ensure inputs, cards and text are readable on the site's dark background.
*/
.card {
    background: rgba(255,255,255,0.02); /* subtle lift on dark bg */
    color: var(--text-light);
    border-color: rgba(255,255,255,0.08);
}

.card .card-title,
.card h1, .card h2, .card h3, .card h4, .card h5 {
    color: var(--text-light);
}

.card .card-text,
.card p,
.card small,
.card .text-muted {
    color: var(--text-muted);
}

.form-control {
    background: #1e2224; /* consistent dark input */
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-light);
}

.form-control::placeholder {
    color: rgba(255,255,255,0.45);
}

/* Buttons on dark backgrounds */
.btn-outline-light {
    color: #fff;
    border-color: rgba(255,255,255,0.18);
}

.btn-outline-light:hover,
.btn-outline-light:focus {
    color: #000;
    background: #fff;
    border-color: #fff;
}

/* Top Info Bar */
.top-info-bar {
    background: var(--darker-bg);
    color: var(--text-muted);
    padding: 10px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid #222;
}

.top-info-bar i {
    color: var(--primary-color);
}

/* Navigation Styles */
header nav {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0, 212, 255, 0.1);
    transition: all 0.3s ease;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header nav.navbar-scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 4px 30px rgba(0, 212, 255, 0.2);
}

.logo-img {
    height: 50px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 300;
    letter-spacing: 0.5px;
}

.navbar-nav .nav-link {
    color: var(--text-light) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::before,
.navbar-nav .nav-link.active::before {
    width: 80%;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link i {
    font-size: 0.9rem;
}

.btn-primary-custom {
    background: var(--gradient-primary);
    color: var(--text-light);
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.5);
    color: var(--text-light);
}

/* Main Content */
main {
    min-height: calc(100vh - 400px);
}

/* Ensure consistent padding around page content */
.site-content {
    padding: 20px !important;
}

/* Footer Styles */
.footer-main {
    background: var(--darker-bg);
    color: var(--text-muted);
    padding: 4rem 0 1rem;
    margin-top: 5rem;
    border-top: 1px solid #222;
}

.footer-logo {
    height: 40px;
    width: auto;
}

.footer-heading {
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--gradient-primary);
}

.footer-text {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 0.95rem;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.footer-links a i {
    font-size: 0.7rem;
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-links a:hover i {
    transform: translateX(3px);
}

.footer-contact {
    list-style: none;
    padding: 0;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.footer-contact li i {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-right: 1rem;
    margin-top: 2px;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #333;
}

.social-icon:hover {
    background: var(--gradient-primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.4);
}

.footer-divider {
    border-color: #222;
    margin: 2rem 0 1.5rem;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-copyright a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Utility Classes */
.bg-dark-gradient {
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animation Classes */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Focus States */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem rgba(0, 212, 255, 0.5), 0 0 0 0.25rem rgba(0, 212, 255, 0.25);
}

/* Form Styles */
.form-control {
    background: var(--card-bg);
    border: 1px solid #333;
    color: var(--text-light);
    padding: 0.75rem 1rem;
}

.form-control:focus {
    background: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--text-light);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid #333;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.2);
    border-color: var(--primary-color);
}

/* Dark panel used instead of Bootstrap's bg-light in dark theme pages */
.bg-panel {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    color: var(--text-light) !important;
    border: 1px solid rgba(255,255,255,0.04);
}

/* Make list-group items readable on dark backgrounds */
.list-group-item {
    background: transparent;
    color: var(--text-light);
    border: none;
}

.list-group-item.bg-panel {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    color: var(--text-light);
    border: 1px solid rgba(255,255,255,0.04);
}

/* Responsive */
@media (max-width: 991px) {
    .navbar-nav {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #333;
    }

    .btn-primary-custom {
        margin-top: 1rem;
        width: 100%;
    }

    .footer-main {
        text-align: center;
    }

    .footer-heading::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .social-icons {
        justify-content: center;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--darker-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00b8d4;
}

/* Improve header layout when zoomed or on medium-large narrow viewports */
@media (max-width: 1400px) {
    .navbar-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .navbar-brand .brand-title {
        font-size: 1.2rem;
        text-align: center;
    }

    .logo-img {
        height: 44px;
    }

    /* Slightly reduce nav link text so items fit on one line */
    .navbar-nav .nav-link {
        font-size: 0.95rem;
        padding: 0.45rem 0.8rem !important;
    }

    /* Keep button a bit smaller on tighter widths */
    .btn-primary-custom {
        padding: 0.45rem 1.1rem;
        font-size: 0.95rem;
    }
}

/* Admin dashboard card overrides for better contrast and smaller size */
.admin-card {
    background: transparent; /* keep page background (dark) */
    color: var(--text-light);
    border: 2px solid #ffffff; /* white border for contrast */
    border-radius: 12px;
}

.admin-card .card-body {
    padding: 1.6rem;
    min-height: 140px; /* slightly smaller */
}

.admin-card img {
    height: 64px;
    width: auto;
    filter: none;
    background: transparent;
}

.admin-card .card-title {
    color: var(--text-light);
    font-weight: 600;
}

.admin-card .card-text {
    color: var(--text-muted);
}

.message-card {
    background: transparent;
    border: 2px solid #ffffff;
    color: var(--text-light);
    border-radius: 10px;
}

.message-card .card-body {
    padding: 1rem 1.25rem;
}

.message-card input.border-white {
    border-color: #ffffff !important;
}

@media (min-width: 992px) {
    .admin-card-col {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Make muted text readable on dark background */
.text-muted {
    color: rgba(255,255,255,0.70) !important;
}