/**
 * Main Stylesheet
 * IdeasGMA - Learning Management System
 *
 * Color Palette:
 * Primary Blue: #1B4D7C
 * Secondary Cyan: #00BFEA
 * White: #FFFFFF
 * Light Gray: #F5F7FA
 * Text Gray: #333333
 */

/* Animated gradient border angle */
@property --gradient-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes gradient-spin {
    to { --gradient-angle: 360deg; }
}

/* ========================================
   CSS Reset & Base
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #333333;
    background-color: #F5F7FA;
    min-height: 100vh;
}

a {
    color: #1B4D7C;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #00BFEA;
}

img {
    max-width: 100%;
    height: auto;
}

ul, ol {
    list-style: none;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    color: #1B4D7C;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p {
    margin-bottom: 1rem;
}

small {
    font-size: 0.875rem;
    color: #666;
}

/* ========================================
   Layout
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-content {
    min-height: calc(100vh - 160px);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: #1B4D7C;
    color: #FFFFFF;
    border-color: #1B4D7C;
}

.btn-primary:hover:not(:disabled) {
    background: #153d62;
    border-color: #153d62;
    color: #FFFFFF;
}

.btn-secondary {
    background: #00BFEA;
    color: #FFFFFF;
    border-color: #00BFEA;
}

.btn-secondary:hover:not(:disabled) {
    background: #009cc4;
    border-color: #009cc4;
    color: #FFFFFF;
}

.btn-outline {
    background: transparent;
    color: #1B4D7C;
    border-color: #1B4D7C;
}

.btn-outline:hover:not(:disabled) {
    background: #1B4D7C;
    color: #FFFFFF;
}

/* Gradient border button for landing page */
.landing-page .btn-outline {
    position: relative;
    color: #1B4D7C;
    border: 2px solid transparent;
    background:
        linear-gradient(#fff, #fff) padding-box,
        conic-gradient(from var(--gradient-angle), #1B4D7C, #00BFEA, #1B4D7C) border-box;
    animation: gradient-spin 3s linear infinite;
    transition: color 0.3s ease;
}

.landing-page .btn-outline:hover:not(:disabled) {
    background:
        linear-gradient(#1B4D7C, #1B4D7C) padding-box,
        conic-gradient(from var(--gradient-angle), #1B4D7C, #00BFEA, #1B4D7C) border-box;
    color: #FFFFFF;
}

.btn-danger {
    background: #dc3545;
    color: #FFFFFF;
    border-color: #dc3545;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
    border-color: #c82333;
    color: #FFFFFF;
}

.btn-success {
    background: #28a745;
    color: #FFFFFF;
    border-color: #28a745;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
    border-color: #218838;
    color: #FFFFFF;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Ensure nav buttons have correct colors */
.nav-menu .btn-primary,
.nav-menu .btn-primary:hover {
    color: #FFFFFF;
}

.btn-block {
    width: 100%;
}

/* ========================================
   Forms
   ======================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00BFEA;
    box-shadow: 0 0 0 3px rgba(0, 191, 234, 0.1);
}

.form-group input:disabled,
.form-group select:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

.required {
    color: #dc3545;
}

.optional {
    color: #666;
    font-weight: normal;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

/* File input */
.file-input {
    display: none;
}

/* ========================================
   Alerts
   ======================================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert p {
    margin: 0;
}

.alert p + p {
    margin-top: 0.5rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ========================================
   Header
   ======================================== */
.main-header {
    background: #FFFFFF;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    gap: 2rem;
}

.logo img {
    height: 50px;
    width: auto;
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-menu a {
    color: #333;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: #00BFEA;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    transition: transform 0.2s;
}

/* User dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #1B4D7C;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initial {
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
}

.dropdown-menu li a:hover {
    background: #f5f7fa;
    color: #00BFEA;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 0.5rem 0;
}

/* ========================================
   Footer
   ======================================== */
.main-footer {
    background: #1B4D7C;
    color: #fff;
    padding: 3rem 0 1rem;
    margin-top: auto;
}

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

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    height: 40px;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1);
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.footer-links h4,
.footer-legal h4,
.footer-contact h4 {
    color: #00BFEA;
    margin-bottom: 1rem;
}

.footer-links ul li,
.footer-legal ul li,
.footer-contact ul li {
    margin-bottom: 0.5rem;
}

.footer-links a,
.footer-legal a,
.footer-contact a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-links a:hover,
.footer-legal a:hover,
.footer-contact a:hover {
    color: #00BFEA;
}

.footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.footer-social a:hover {
    background: #00BFEA;
    color: #fff;
    transform: translateY(-3px);
}

.footer-social svg {
    width: 20px;
    height: 20px;
}

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

.footer-bottom p {
    margin: 0;
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2,
.card-header h3 {
    margin: 0;
}

.card-body {
    padding: 1.25rem;
}

/* ========================================
   Progress Bar
   ======================================== */
.progress-bar {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1B4D7C, #00BFEA);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.875rem;
    color: #666;
    margin: 0;
}

/* ========================================
   Tabs
   ======================================== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #eee;
    margin-bottom: 1.5rem;
}

.tab {
    padding: 1rem 1.5rem;
    color: #666;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab:hover {
    color: #1B4D7C;
}

.tab.active {
    color: #1B4D7C;
    border-bottom-color: #00BFEA;
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: #666;
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* ========================================
   Tables
   ======================================== */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    font-weight: 600;
    color: #1B4D7C;
    background: #f9fafb;
}

tr:hover {
    background: #f9fafb;
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
}

.pagination-info {
    color: #666;
}

/* ========================================
   Modal
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
}

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

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

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

.modal-lg {
    max-width: 700px;
}

.modal-sm {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-form {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    margin-top: 1rem;
}

/* ========================================
   Badges
   ======================================== */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
}

.status-active, .status-published {
    background: #d4edda;
    color: #155724;
}

.status-inactive, .status-archived {
    background: #f8d7da;
    color: #721c24;
}

.status-pending, .status-draft {
    background: #fff3cd;
    color: #856404;
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
}

.role-admin {
    background: #1B4D7C;
    color: #fff;
}

.role-student {
    background: #00BFEA;
    color: #fff;
}

/* ========================================
   Utility Classes
   ======================================== */
.hidden {
    display: none !important;
}

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

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

.inline-form {
    display: inline;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 1rem;
        gap: 0;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        display: none;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a,
    .nav-menu .btn {
        display: block;
        width: 100%;
        padding: 1rem;
        text-align: center;
    }

    .nav-dropdown {
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
    }

    .nav-dropdown.active .dropdown-menu {
        display: block;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }

    .form-row {
        flex-direction: column;
    }

    .form-row .form-group {
        min-width: 100%;
    }
}
