/* ==========================================
   NEXORA BUSINESS - DESIGN SYSTEM & STYLES
   ========================================== */

/* Theme Variables */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary-color: #0f172a;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --transition: all 0.3s ease;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
    --radius: 12px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Kanit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

/* Container */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================
   NAVBAR (Landing Page)
   ========================================== */
.navbar {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.navbar .container {
    height: 75px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius);
    font-size: 1.25rem;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Common Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
}

/* ==========================================
   LANDING PAGE (index.html)
   ========================================== */
/* Hero Section */
.hero {
    padding: 120px 0 80px;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 40%),
                radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.03), transparent 30%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.hero-content h1 span {
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.hero-actions {
    display: flex;
    gap: 15px;
}

.hero-image img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 4px solid white;
}

/* Services Section */
.services {
    padding: 80px 0;
    background-color: white;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 50px;
}

.section-header h2 {
    font-size: 2.25rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.section-header p {
    color: var(--text-muted);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    padding: 40px 30px;
    background-color: var(--bg-main);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(37, 99, 235, 0.2);
}

.service-icon {
    width: 50px;
    height: 50px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.service-card h3 {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

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

/* Contact Section */
.contact {
    padding: 80px 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 50px;
    align-items: start;
}

.contact-info {
    padding-right: 20px;
}

.contact-info h3 {
    font-size: 1.75rem;
    margin-bottom: 20px;
}

.contact-info p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.contact-method-icon {
    width: 45px;
    height: 45px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* ==========================================
   AUTHENTICATION PAGES (login, register)
   ========================================== */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
    padding: 20px;
}

.auth-card {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.8);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header .logo {
    justify-content: center;
    margin-bottom: 15px;
}

.auth-header h2 {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    background-color: var(--bg-main);
    border-radius: var(--radius);
    transition: var(--transition);
    color: var(--text-main);
}

.form-control:focus {
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 600;
}

/* ==========================================
   DASHBOARD LAYOUT (Admin & Member)
   ========================================== */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--secondary-color);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar .logo {
    color: white;
    margin-bottom: 40px;
}

.sidebar .logo-text {
    color: white;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: #94a3b8;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-link:hover, .sidebar-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-link.active {
    background-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.sidebar-user {
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-user-info {
    max-width: 170px;
}

.sidebar-username {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: #94a3b8;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 3px;
    text-transform: uppercase;
}

.btn-logout {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #ef4444;
    color: white;
}

/* Main Dashboard Panel */
.main-panel {
    flex-grow: 1;
    margin-left: 280px;
    padding: 40px;
    background-color: var(--bg-main);
    min-height: 100vh;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h1 {
    font-size: 1.75rem;
    color: var(--secondary-color);
}

.current-date-badge {
    background-color: white;
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    font-weight: 500;
    color: var(--text-muted);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    padding: 25px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info h4 {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
}

.stat-icon.primary { background-color: var(--primary-light); color: var(--primary-color); }
.stat-icon.success { background-color: var(--success-light); color: var(--success); }
.stat-icon.warning { background-color: var(--warning-light); color: var(--warning); }
.stat-icon.danger { background-color: var(--danger-light); color: var(--danger); }

/* Dashboard Cards and Columns */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

.dashboard-grid.equal {
    grid-template-columns: 1fr 1fr;
}

.card {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.card-body {
    padding: 25px;
}

/* ==========================================
   SPECIFIC COMPONENT UI
   ========================================== */

/* Time Attendance Widget */
.clock-widget {
    text-align: center;
    padding: 30px 10px;
}

.clock-display {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 5px;
    font-family: monospace;
}

.date-display {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 25px;
}

.clock-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

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

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

.table th {
    padding: 14px 20px;
    background-color: var(--bg-main);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    vertical-align: middle;
}

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

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: capitalize;
}

.badge-pending {
    background-color: var(--warning-light);
    color: var(--warning);
}

.badge-approved {
    background-color: var(--success-light);
    color: var(--success);
}

.badge-rejected {
    background-color: var(--danger-light);
    color: var(--danger);
}

.badge-admin {
    background-color: #ede9fe;
    color: #6d28d9;
}

.badge-member {
    background-color: #e0f2fe;
    color: #0369a1;
}

/* Announcement list */
.announcement-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.announcement-item {
    border-left: 4px solid var(--primary-color);
    background-color: var(--bg-main);
    padding: 15px 20px;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.announcement-title {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.announcement-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.announcement-content {
    color: var(--text-main);
    font-size: 0.9rem;
}

/* Custom Modals or Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: white;
    color: var(--text-main);
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border-left: 5px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    transform: translateX(120%);
    animation: slideIn 0.3s forwards, fadeOut 0.3s 2.7s forwards;
    pointer-events: auto;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideIn {
    to { transform: translateX(0); }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-20px); }
}

/* Dashboard Sections Toggle */
.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
}

/* Modal Form Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

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

.modal-content {
    background-color: white;
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

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

.close-btn:hover {
    color: var(--secondary-color);
}

/* FOOTER (landing page) */
.footer {
    background-color: var(--secondary-color);
    color: #94a3b8;
    padding: 60px 0 30px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .logo {
    color: white;
    margin-bottom: 20px;
}

.footer-brand p {
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-links h4 {
    color: white;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.05);
    text-align: center;
    font-size: 0.85rem;
}

/* Responsive Utilities */
@media (max-width: 992px) {
    .sidebar {
        width: 80px;
        padding: 20px 10px;
    }
    .sidebar .logo-text, .sidebar-username, .sidebar-user-role {
        display: none;
    }
    .sidebar-link span:last-child {
        display: none;
    }
    .sidebar-link {
        justify-content: center;
    }
    .sidebar-user {
        justify-content: center;
    }
    .main-panel {
        margin-left: 80px;
    }
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-actions {
        justify-content: center;
    }
    .hero-image {
        display: flex;
        justify-content: center;
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-grid.equal {
        grid-template-columns: 1fr;
    }
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .nav-links {
        display: none; /* simple stack */
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
}