﻿/* ========================================
   MYTB Care Global Theme Variables & Styles
   ======================================== */

:root {
    /* Primary Colors - Medical Teal */
    --primary-color: #00a3b5;
    --primary-dark: #007d8c;
    --primary-light: #33b5c4;
    --primary-lighter: #e0f7fa;
    /* Secondary Colors */
    --success-color: #10b981;
    --success-dark: #059669;
    --warning-color: #f59e0b;
    --warning-dark: #d97706;
    --danger-color: #ef4444;
    --danger-dark: #dc2626;
    --info-color: #0ea5e9;
    --info-dark: #0284c7;
    /* Accent Colors */
    --accent-coral: #ff6b6b;
    --accent-gold: #ffd93d;
    --accent-purple: #6c5ce7;
    /* Neutral Colors */
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --gray: #e9ecef;
    --dark-gray: #495057;
    --text-dark: #2c3e50;
    --text-muted: #6c757d;
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.2);
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #00a3b5 0%, #00d4cc 100%);
    --gradient-success: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --gradient-warning: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    --gradient-danger: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    --gradient-dark: linear-gradient(135deg, #007d8c 0%, #00a3b5 100%);
    --gradient-light: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
    /* Border Radius */
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
}

/* ========================================
   Global Styles
   ======================================== */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
    font-weight: 700;
}

.text-primary-theme {
    color: var(--primary-color) !important;
}

.text-secondary-theme {
    color: var(--text-muted) !important;
}

/* ========================================
   Module/Page Cards (For ASCX Controls)
   ======================================== */
.module-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray);
    margin-bottom: 2rem;
    overflow: hidden;
}

.module-card-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
}

    .module-card-header h5 {
        margin: 0;
        font-weight: 700;
        font-size: 1.25rem;
        color: white;
    }

    .module-card-header i {
        margin-right: 0.75rem;
    }

.module-card-body {
    padding: 2rem;
}

/* ========================================
   Cards (General - For Login & Other Pages)
   ======================================== */
.card-theme {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .card-theme:hover {
        transform: translateY(-5px);
        box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3);
    }

.card-header-theme {
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
    padding: 1.5rem;
    border: none;
}

/* ========================================
   Tables
   ======================================== */
.table-theme {
    width: 100%;
    margin-bottom: 0;
    border-radius: var(--border-radius);
    overflow: hidden;
}

    .table-theme thead {
        background: var(--gradient-primary);
        color: white;
    }

        .table-theme thead th {
            border: none;
            padding: 1rem;
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.85rem;
            letter-spacing: 0.5px;
        }

    .table-theme tbody td {
        padding: 1rem;
        vertical-align: middle;
        border-bottom: 1px solid var(--gray);
    }

    .table-theme tbody tr {
        transition: all 0.3s ease;
    }

        .table-theme tbody tr:hover {
            background: rgba(0, 163, 181, 0.05);
        }

        .table-theme tbody tr:last-child td {
            border-bottom: none;
        }

/* Empty State for Tables */
.table-empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

    .table-empty-state i {
        font-size: 3rem;
        color: var(--text-muted);
        margin-bottom: 1rem;
        display: block;
    }

    .table-empty-state p {
        color: var(--text-muted);
        margin: 0;
    }

/* ========================================
   Buttons - New Centralized Classes
   ======================================== */
.btn-theme-primary {
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 163, 181, 0.3);
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
}

    .btn-theme-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 163, 181, 0.4);
        color: white;
        text-decoration: none;
    }

.btn-theme-success {
    background: var(--gradient-success);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
}

    .btn-theme-success:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4);
        color: white;
        text-decoration: none;
    }

.btn-theme-warning {
    background: white;
    border: 2px solid var(--warning-dark);
    color: var(--warning-dark);
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
}

    .btn-theme-warning:hover {
        background: var(--warning-dark);
        color: white;
        transform: translateY(-2px);
        text-decoration: none;
    }

.btn-theme-danger {
    background: var(--gradient-danger);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
}

    .btn-theme-danger:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
        color: white;
        text-decoration: none;
    }

.btn-theme-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

/* ========================================
   Buttons - Legacy (For Login Page)
   ======================================== */
.btn-primary-theme {
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    padding: 0.95rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 163, 181, 0.35);
    position: relative;
    overflow: hidden;
}

    .btn-primary-theme::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s ease;
    }

    .btn-primary-theme:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(0, 163, 181, 0.45);
        color: white;
    }

        .btn-primary-theme:hover::before {
            left: 100%;
        }

    .btn-primary-theme:active {
        transform: translateY(0);
    }

.btn-secondary-theme {
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 0.875rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--primary-color);
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

    .btn-secondary-theme:hover {
        background: var(--primary-color);
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 163, 181, 0.3);
    }

.btn-outline-theme {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

    .btn-outline-theme:hover {
        background: var(--primary-color);
        color: white;
        transform: translateY(-2px);
    }

.btn-block {
    width: 100%;
    display: block;
}

/* ========================================
   Form Controls
   ======================================== */
.form-group-theme {
    margin-bottom: 1.5rem;
}

.form-label-theme {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    display: block;
}

    .form-label-theme i {
        margin-right: 0.6rem;
        color: var(--primary-color);
        font-size: 1rem;
    }

.form-control-theme {
    border: 2px solid var(--gray);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    width: 100%;
    background: var(--light-gray);
    color: var(--text-dark);
}

    .form-control-theme:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px rgba(0, 163, 181, 0.1);
        background: var(--white);
        outline: none;
    }

    .form-control-theme::placeholder {
        color: #adb5bd;
        font-size: 0.9rem;
    }

/* Checkbox Styling */
.checkbox-theme {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* ========================================
   Validation & Errors
   ======================================== */
.validation-error {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    font-weight: 500;
    display: block;
}

/* ========================================
   Badges & Labels
   ======================================== */
.badge-theme-active {
    background: var(--success-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-block;
}

.badge-theme-inactive {
    background: var(--dark-gray);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-block;
}

.badge-theme-primary {
    background: var(--primary-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-block;
}

.badge-theme-success {
    background: var(--success-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-block;
}

.badge-theme-warning {
    background: var(--warning-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-block;
}

.badge-theme-danger {
    background: var(--danger-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-block;
}

/* ========================================
   Login Page Specific
   ======================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
}

    .login-container::before {
        content: '';
        position: absolute;
        width: 600px;
        height: 600px;
        background: radial-gradient(circle, rgba(0, 163, 181, 0.15) 0%, transparent 70%);
        border-radius: 50%;
        top: -300px;
        right: -200px;
        animation: float 15s ease-in-out infinite;
    }

    .login-container::after {
        content: '';
        position: absolute;
        width: 400px;
        height: 400px;
        background: radial-gradient(circle, rgba(255, 107, 107, 0.1) 0%, transparent 70%);
        border-radius: 50%;
        bottom: -150px;
        left: -100px;
        animation: float 12s ease-in-out infinite reverse;
    }

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

.login-card {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 10;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-container-theme {
    background: var(--gradient-primary);
    padding: 2.5rem 2rem;
    margin: -1rem -1rem 2rem -1rem;
    position: relative;
    overflow: hidden;
}

    .logo-container-theme::before {
        content: '';
        position: absolute;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
        top: -50%;
        left: -50%;
        animation: rotate 20s linear infinite;
    }

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.logo-container-theme img {
    max-width: 280px;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.login-title {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

hr.border-theme {
    border: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--primary-color), transparent);
    margin: 1.5rem 0;
    opacity: 0.3;
}

.form-group {
    margin-bottom: 1.5rem;
}

.security-info {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray);
}

    .security-info i {
        color: var(--primary-color);
        margin-right: 0.4rem;
    }

    .security-info span {
        color: var(--text-muted);
        font-size: 0.85rem;
        font-weight: 500;
    }

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

    .login-footer a {
        color: var(--primary-color);
        text-decoration: none;
        font-weight: 600;
        transition: color 0.3s ease;
    }

        .login-footer a:hover {
            color: var(--primary-dark);
            text-decoration: underline;
        }

.btn-loading {
    position: relative;
    pointer-events: none;
}

    .btn-loading::after {
        content: '';
        position: absolute;
        width: 16px;
        height: 16px;
        top: 50%;
        left: 50%;
        margin-left: -8px;
        margin-top: -8px;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        border-top-color: white;
        animation: spinner 0.6s linear infinite;
    }

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Navigation & Sidebar
   ======================================== */
.navbar-theme {
    background: var(--gradient-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-theme {
    background: linear-gradient(180deg, var(--primary-dark), var(--primary-color));
    color: white;
}

    .sidebar-theme .nav-link {
        color: rgba(255, 255, 255, 0.85);
        transition: all 0.3s ease;
        border-radius: var(--border-radius);
        margin: 0.25rem 0.5rem;
    }

        .sidebar-theme .nav-link:hover,
        .sidebar-theme .nav-link.active {
            background: rgba(255, 255, 255, 0.15);
            color: white;
        }

/* ========================================
   Modals
   ======================================== */
.modal-theme .modal-header {
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.modal-theme .modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   Alerts
   ======================================== */
.alert-theme-success {
    background: rgba(5, 150, 105, 0.1);
    border-left: 4px solid var(--success-color);
    color: var(--success-color);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.alert-theme-warning {
    background: rgba(217, 119, 6, 0.1);
    border-left: 4px solid var(--warning-color);
    color: var(--warning-color);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.alert-theme-error {
    background: rgba(220, 38, 38, 0.1);
    border-left: 4px solid var(--danger-color);
    color: var(--danger-color);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.alert-theme-info {
    background: rgba(2, 132, 199, 0.1);
    border-left: 4px solid var(--info-color);
    color: var(--info-color);
    border-radius: var(--border-radius);
    padding: 1rem;
}

/* ========================================
   Utilities
   ======================================== */
.bg-theme-gradient {
    background: var(--gradient-primary);
}

.border-theme {
    border-color: var(--gray) !important;
}

.shadow-theme {
    box-shadow: var(--shadow-md);
}

.shadow-theme-hover:hover {
    box-shadow: var(--shadow-lg);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .module-card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .module-card-body {
        padding: 1rem;
    }

    .login-card {
        margin: 1rem;
    }

    .logo-container-theme {
        padding: 2rem 1.5rem;
    }

        .logo-container-theme img {
            max-width: 220px;
            max-height: 100px;
        }
}

@media (max-width: 576px) {
    .login-container {
        padding: 1rem 0.5rem;
    }

    .login-card {
        max-width: 100%;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .card-theme {
        border-radius: 16px;
    }

    .btn-primary-theme,
    .btn-secondary-theme {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* ========================================
   Accessibility
   ======================================== */
.form-control-theme:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .login-container {
        background: white;
    }

    .module-card {
        box-shadow: none;
        border: 1px solid var(--gray);
    }
}
