/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body { 
    font-family: 'dana', sans-serif; 
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: #f5f5f5;
    color: #333;
}

/* Layout Structure */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar { 
    width: 280px;
    background: #2c3e50;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    position: fixed;
    height: 100vh;
    right: 0;
    top: 0;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    background: #34495e;
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #4a5f7a;
}

.sidebar-logo {
    width: 90px;
    height: 90px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    background: white;
    padding: 5px;
}

.sidebar-header h5 {
    color: white;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

/* Ensure sidebar headers use relative font sizes */
.sidebar-header h5, .sidebar-header p {
    font-size: inherit !important;
}

.sidebar-header p {
    color: #bdc3c7;
    margin: 5px 0 0 0;
    font-size: 14px;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar .nav-link {
    color: #ecf0f1;
    padding: 18px 25px;
    border: none;
    border-radius: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    margin: 0;
}

.sidebar .nav-link:hover {
    color: white;
    background: #34495e;
    transform: translateX(-5px);
}

.sidebar .nav-link.active {
    color: white;
    background: #3498db;
    border-right: 4px solid #2980b9;
}

.sidebar .nav-link i {
    font-size: 20px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar .nav-link span {
    flex: 1;
    text-align: right;
}

.sidebar .nav-link.logout {
    color: #e74c3c;
    border-top: 1px solid #4a5f7a;
    margin-top: 20px;
}

.sidebar .nav-link.logout:hover {
    background: #c0392b;
    color: white;
}

/* Sidebar Version Footer */
.sidebar-version {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a252f;
    border-top: 1px solid #4a5f7a;
    padding: 15px 20px;
}

.version-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #95a5a6;
    font-size: 12px;
    font-weight: 500;
}

.version-info i {
    font-size: 14px;
    color: #7f8c8d;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: 280px;
    background: #f5f5f5;
    min-height: 100vh;
}

/* Header */
.main-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px 30px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
    margin: 0;
}

.header-left p {
    color: #7f8c8d;
    margin: 5px 0 0 0;
    font-size: 16px;
}

/* Ensure main header elements use relative font sizes */
.header-left h1, .header-left p {
    font-size: inherit !important;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Font Size Control */
.font-size-control {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    position: relative;
    z-index: 1001;
    /* Prevent any movement or jumping */
    transform: translateZ(0);
    will-change: auto;
}

/* Ensure font size control elements are not affected by global font size changes */
.font-size-control label,
.font-size-control .form-range,
.font-size-control .font-size-percent {
    font-size: 14px !important;
}

.font-size-control label {
    margin: 0;
    color: #495057;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.font-size-control .form-range {
    width: 120px;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    border: 1px solid #ced4da;
    margin: 0 10px;
}

.font-size-control .form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.font-size-control .form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.font-size-control .form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.font-size-control .form-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.font-size-control .form-range::-webkit-slider-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    height: 6px;
}

.font-size-control .form-range::-moz-range-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    height: 6px;
}

.font-size-percent {
    font-size: 12px;
    color: #000;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

/* Meeting row cursor pointer */
.meeting-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.meeting-row:hover {
    background-color: #f8f9fa !important;
}

.meeting-row .actions {
    cursor: default;
}

.meeting-row .actions .btn {
    cursor: pointer;
}

.font-size-control .size-display {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* CSS Custom Properties for Font Sizes */
:root {
    --base-font-size: 1rem;
    --font-size-multiplier: 1;
}

/* Apply font size multiplier to ALL text elements globally */
html, body, div, span, h1, h2, h3, h4, h5, h6, p, a, button, input, select, textarea, label, table, th, td, tr, ul, ol, li, nav, header, footer, aside, main, section, article, form, fieldset, legend, caption, thead, tbody, tfoot, blockquote, cite, code, pre, em, strong, b, i, small, sub, sup, mark, time, address, details, summary, figcaption, figure, .sidebar, .main-content, .content-area, .card, .alert, .badge, .btn, .form-control, .form-select, .nav-link, .table, .modal, .modal-header, .modal-body, .modal-footer, .page-title, .sidebar-header, .sidebar-nav, .version-info, .card-title, .card-header, .table-container {
    font-size: calc(var(--base-font-size) * var(--font-size-multiplier));
}

/* Exclude ONLY the font size control elements */
.font-size-control,
.font-size-control *,
.font-size-control label,
.font-size-control .form-range,
.font-size-control .font-size-percent,
input[type="range"],
.form-range {
    font-size: 14px !important;
}

/* Smooth transitions for font size changes */
html, body, div, span, h1, h2, h3, h4, h5, h6, p, a, button, input, select, textarea, label, table, th, td, tr, ul, ol, li, nav, header, footer, aside, main, section, article, form, fieldset, legend, caption, thead, tbody, tfoot, blockquote, cite, code, pre, em, strong, b, i, small, sub, sup, mark, time, address, details, summary, figcaption, figure, .sidebar, .main-content, .content-area, .card, .alert, .badge, .btn, .form-control, .form-select, .nav-link, .table, .modal, .modal-header, .modal-body, .modal-footer, .page-title, .sidebar-header, .sidebar-nav, .version-info, .card-title, .card-header, .table-container {
    transition: font-size 0.2s ease-out;
}

/* Content Area */
.content-area {
    padding: 30px;
}

.page-title {
    background: white;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    border-right: 5px solid #3498db;
}

.page-title h1 {
    color: #2c3e50;
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.page-title p {
    color: #7f8c8d;
    margin: 10px 0 0 0;
    font-size: 16px;
}

/* Ensure all headings use relative font sizes */
h1, h2, h3, h4, h5, h6 {
    font-size: inherit !important;
}

/* Ensure page title elements also use relative font sizes */
.page-title h1, .page-title p {
    font-size: inherit !important;
}

/* Cards and Tables */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border: none;
    margin-bottom: 25px;
}

.card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 20px 25px;
    border-radius: 12px 12px 0 0;
}

.card-title {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* Ensure card titles also use relative font sizes */
.card-title, .card-header h5 {
    font-size: inherit !important;
}

.table-container {
    padding: 25px;
}

.table {
    margin: 0;
    font-size: var(--table-font-size, 14px);
}

.table th {
    background: #f8f9fa;
    border: none;
    padding: 15px 12px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.table td {
    padding: 15px 12px;
    border-color: #e9ecef;
    vertical-align: middle;
}

/* Ensure table elements use relative font sizes */
.table, .table th, .table td, .table * {
    font-size: inherit !important;
}

.table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 10px 20px;
    transition: all 0.3s ease;
    border: none;
    font-size: 14px;
}

/* Ensure buttons use relative font sizes */
.btn, .btn * {
    font-size: inherit !important;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Modals */
.modal-content {
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    border: none;
}

.modal-header {
    background: #2c3e50;
    color: white;
    border-radius: 16px 16px 0 0;
    padding: 25px 30px;
}

.modal-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

/* Ensure modal elements use relative font sizes */
.modal-title, .modal-body, .modal-footer, .modal * {
    font-size: inherit !important;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    transition: all 0.3s ease;
    font-size: 14px;
}

/* Ensure form elements use relative font sizes */
.form-control, .form-select, .form-label {
    font-size: inherit !important;
}

.form-control:focus, .form-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Badges */
.badge {
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 12px;
}

/* Ensure badges use relative font sizes */
.badge, .badge * {
    font-size: inherit !important;
}

.badge.bg-success {
    background: #27ae60 !important;
}

.badge.bg-danger {
    background: #e74c3c !important;
}

.badge.bg-warning {
    background: #f39c12 !important;
}

.badge.bg-info {
    background: #3498db !important;
}

.badge.bg-primary {
    background: #2980b9 !important;
}

/* Alerts */
.alert {
    border-radius: 12px;
    border: none;
    padding: 20px 25px;
    margin-bottom: 25px;
    font-size: 14px;
}

/* Ensure alerts use relative font sizes */
.alert, .alert * {
    font-size: inherit !important;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Refresh interval dropdown styling */
.refresh-interval {
    min-width: 120px;
    background-position: left 0.75rem center;
    background-size: 16px 12px;
    padding-left: 2.5rem;
    padding-right: 0.75rem;
}

.refresh-interval:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Ensure dropdown arrow doesn't overlap text */
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 16px 12px;
    padding-left: 2.5rem;
    padding-right: 0.75rem;
}

/* RTL support for form selects */
[dir="rtl"] .form-select {
    background-position: right 0.75rem center;
    padding-left: 0.75rem;
    padding-right: 2.5rem;
}

/* Modal Header RTL Support */
.modal-header {
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: center;
}

.modal-header .btn-close {
    margin: 0;
    margin-left: 0;
    margin-right: auto;
}

.modal-header .modal-title {
    margin: 0;
    margin-right: auto;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .sidebar {
        width: 250px;
    }
    
    .main-content {
        margin-right: 250px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-right: 0;
    }
    
    .wrapper {
        flex-direction: column;
    }
    
    .font-size-control {
        position: relative;
        top: auto;
        left: auto;
        margin: 10px 0;
    }
    
    .content-area {
        padding: 20px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* Login Page Styles */
.login-container {
    max-width: 400px;
    margin: 100px auto;
}

.login-container .card {
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 2rem;
}

.login-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.login-header h1 {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }