/**
 * IMS-HTMD Global Styles
 * 
 * Common styles used across all pages
 */

/* ======================
   CSS Variables
   ====================== */

:root {
    --primary-color: #004aad;
    --primary-dark: #003380;
    --primary-light: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;

    --body-bg: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #1a1a2e;
    --text-muted: #6c757d;

    --border-radius: 0.5rem;
    --border-radius-lg: 1rem;
    --box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.15);

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ======================
   Base Styles
   ====================== */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ======================
   Typography
   ====================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ======================
   Cards
   ====================== */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    border: none;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

/* ======================
   Buttons
   ====================== */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all var(--transition-fast);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    box-shadow: 0 5px 15px rgba(0, 74, 173, 0.3);
}

/* ======================
   Forms
   ====================== */
.form-control,
.form-select {
    border-radius: var(--border-radius);
    border: 2px solid #e0e0e0;
    padding: 0.65rem 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

/* ======================
   Tables
   ====================== */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead th {
    background: var(--light-color);
    border-bottom: 2px solid var(--primary-light);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* ======================
   Alerts & Notifications
   ====================== */
.alert {
    border: none;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--success-color);
    background: rgba(40, 167, 69, 0.1);
}

.alert-danger {
    border-left-color: var(--danger-color);
    background: rgba(220, 53, 69, 0.1);
}

.alert-warning {
    border-left-color: var(--warning-color);
    background: rgba(255, 193, 7, 0.1);
}

.alert-info {
    border-left-color: var(--info-color);
    background: rgba(23, 162, 184, 0.1);
}

/* ======================
   Badges
   ====================== */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
    border-radius: 0.25rem;
}

/* ======================
   Utilities
   ====================== */
.hover-shadow:hover {
    box-shadow: var(--box-shadow-lg) !important;
    transform: translateY(-5px);
}

.transition-all {
    transition: all var(--transition-normal);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ======================
   Scrollbar
   ====================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* ======================
   Loading Spinner
   ====================== */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--light-color);
    border-radius: 50%;
    border-top-color: var(--primary-light);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ======================
   Fade Animations
   ====================== */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ======================
   Responsive Utilities
   ====================== */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ======================
   Print Styles
   ====================== */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Navbar */
.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--secondary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

@media (max-width: 991px) {
    .auth-buttons {
        margin-top: 10px;
    }
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 85vh;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    background-size: 50px 50px;
    animation: float 20s linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-50px);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
}

.hero .lead {
    font-size: clamp(1rem, 2vw, 1.25rem);
    opacity: 0.95;
}

/* Cards */
.hover-shadow {
    transition: all 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-5px);
}

/* Module Cards */
.module-card {
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.module-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.12);
}

.module-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Divider */
.divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    margin-bottom: 2rem;
}

/* Partners Section */
.partner-logo {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 1rem;
    overflow: hidden;
}

.partner-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.partner-logo img {
    width: 100%;
    max-width: 150px;
    height: auto;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.footer-links a {
    transition: opacity 0.3s ease;
}

.footer-links a:hover {
    opacity: 1 !important;
}

/* Scroll to top button */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
}

/* Loading animation */
.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* login */
/* Card Styling */
.login-card {
    border: none;
    border-radius: 1.5rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

/* Branding Section */
.branding-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    position: relative;
    overflow: hidden;
}

.branding-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1.5" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    background-size: 30px 30px;
    animation: float 30s linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    100% {
        transform: translateY(-30px) rotate(360deg);
    }
}

.branding-section h3 {
    font-size: 1.8rem;
    margin-top: 1rem;
    position: relative;
    z-index: 1;
}

.branding-section p {
    font-size: 0.95rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.branding-section img {
    position: relative;
    z-index: 1;
}

/* Form Styling */
.form-control {
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(25, 118, 210, 0.15);
}

.form-control.is-invalid {
    border-color: #e53935;
    background-image: none;
}

.form-label {
    font-weight: 500;
    color: #555;
    margin-bottom: 0.5rem;
}

/* Button Styling */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(25, 118, 210, 0.3);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Toggle Password Button */
.toggle-btn {
    border: 2px solid #e0e0e0;
    border-left: none;
    background: #f8f9fa;
    border-radius: 0 0.75rem 0.75rem 0;
    transition: all 0.3s ease;
    padding: 0 1rem;
}

.toggle-btn:hover {
    background: #e9ecef;
    color: var(--primary-color);
}

.input-group .form-control {
    border-radius: 0.75rem 0 0 0.75rem;
}

/* Responsive */
@media (max-width: 767px) {
    .branding-section {
        display: none;
    }

    .login-card {
        margin: 1rem;
    }
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Links */
.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Logo styling */
.logo-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

/* register */
.register-card {
    border: none;
    border-radius: 1.5rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    background: #fff;
}

.branding-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    position: relative;
}

.form-control,
.form-select {
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(25, 118, 210, 0.15);
}

.btn-success {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background: linear-gradient(135deg, #1b5e20, var(--success-color));
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(46, 125, 50, 0.3);
}

.toggle-btn {
    border: 2px solid #e0e0e0;
    border-left: none;
    background: #f8f9fa;
    border-radius: 0 0.75rem 0.75rem 0;
}

.input-group .form-control {
    border-radius: 0.75rem 0 0 0.75rem;
}

.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

.logo-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

@media (max-width: 991px) {
    .branding-section {
        display: none;
    }
}

.announcement-content {
    font-size: 0.95rem;
}