/* ==========================================================================
   Design System & Globals (Light Theme - Brand Milcom)
   ========================================================================== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc; /* Sidebar very light blue-grey */
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-hover: rgba(18, 103, 118, 0.4);
    
    --color-text-main: #0e283d; /* Primary deep navy */
    --color-text-body: #334155; /* Slate-700 for body reading */
    --color-text-muted: #475569; /* Slate-600 */
    --color-text-light: #94a3b8; /* Slate-400 */
    
    /* Brand Accents */
    --color-primary: #0e283d;   /* Deep Navy Blue */
    --color-secondary: #126776; /* Teal */
    --color-accent: #4db05b;    /* Milcom Green */
    --color-success: #4db05b;
    --color-danger: #ef4444;
    --color-info: #126776;
    
    --grad-primary: linear-gradient(135deg, #0e283d 0%, #126776 100%);
    --grad-secondary: linear-gradient(135deg, #126776 0%, #4db05b 100%);
    --grad-glow: linear-gradient(135deg, rgba(14, 40, 61, 0.04) 0%, rgba(77, 176, 91, 0.04) 100%);
    
    --font-headings: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
    --font-body: 'Montserrat', sans-serif;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(14, 40, 61, 0.08), 0 4px 6px -4px rgba(14, 40, 61, 0.08);
    --shadow-glow: 0 0 15px rgba(18, 103, 118, 0.15);
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--color-text-body);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Headings typography rules */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headings);
    color: var(--color-primary);
    font-weight: 700;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-secondary);
}

/* ==========================================================================
   Layout Structures
   ========================================================================== */
.app-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 100vh;
}

@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
    }
}

/* Sidebar Styling */
.sidebar {
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--grad-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
}

.logo-area h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}

/* Main Content Styling */
.main-content {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

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

.main-header h1 {
    font-size: 2rem;
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

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

/* Milcom Logo Positioning */
.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo-milcom {
    max-height: 48px;
    width: auto;
    object-fit: contain;
}

/* ==========================================================================
   Reusable Components (Cards, Buttons, Badges)
   ========================================================================== */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(14, 40, 61, 0.04);
}

.card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card p {
    font-size: 0.85rem;
    color: var(--color-text-body);
    margin-bottom: 1rem;
    line-height: 1.4;
}

/* Demo Card Highlight */
.card.highlighted {
    background: var(--grad-glow);
    border-color: rgba(77, 176, 91, 0.3);
}

.demo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.demo-header h3 {
    margin-bottom: 0;
    color: var(--color-secondary);
}

/* Buttons */
.btn {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
}
.btn-primary:hover {
    background-color: #1a3d5a;
    box-shadow: 0 0 12px rgba(14, 40, 61, 0.2);
}

.btn-secondary {
    background-color: #ffffff;
    border-color: #cbd5e1;
    color: var(--color-text-main);
}
.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
}

.btn-gradient {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: var(--shadow-glow);
}
.btn-gradient:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(14, 40, 61, 0.25);
}

.btn-success {
    background-color: var(--color-accent);
    color: #fff;
}
.btn-success:hover:not(:disabled) {
    background-color: #3e964a;
    box-shadow: 0 4px 12px rgba(77, 176, 91, 0.3);
}
.btn-success:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-text {
    background: none;
    border: none;
    color: var(--color-secondary);
    padding: 0;
    justify-content: flex-start;
}
.btn-text:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-demo {
    background-color: rgba(77, 176, 91, 0.12);
    color: #2b7d38;
    border: 1px solid rgba(77, 176, 91, 0.2);
}

.badge-role-presenter {
    background-color: rgba(18, 103, 118, 0.1);
    color: #126776;
    border: 1px solid rgba(18, 103, 118, 0.2);
}

.badge-role-attendee {
    background-color: rgba(77, 176, 91, 0.1);
    color: #2e7d32;
    border: 1px solid rgba(77, 176, 91, 0.2);
}

/* User Profile Badge */
.user-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: #f1f5f9;
    padding: 0.4rem 1rem;
    border-radius: 40px;
    border: 1px solid #cbd5e1;
}

.user-badge img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.user-badge span {
    font-size: 0.85rem;
    font-weight: 600;
}

/* ==========================================================================
   Form Controls / Filters
   ========================================================================== */
.filters-section h2 {
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

@media (max-width: 900px) {
    .filters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .span-2, .span-4 {
        grid-column: span 2 !important;
    }
}
@media (max-width: 600px) {
    .filters-grid {
        grid-template-columns: 1fr;
    }
    .span-2, .span-4, .form-actions {
        grid-column: span 1 !important;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.span-2 {
    grid-column: span 2;
}

.span-4 {
    grid-column: span 4;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.form-group input[type="date"] {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    color: var(--color-text-main);
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}

.form-group input[type="date"]:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 2px rgba(18, 103, 118, 0.15);
}

/* Multi-select Tag Input Container */
.select-container {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    position: relative;
    transition: var(--transition);
}

.select-container:focus-within {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 2px rgba(18, 103, 118, 0.15);
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.placeholder-text {
    color: var(--color-text-light);
    font-size: 0.85rem;
    pointer-events: none;
    padding-left: 0.4rem;
}

.tag {
    background-color: #e2e8f0;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tag .remove-tag {
    cursor: pointer;
    font-weight: 700;
    color: #64748b;
}
.tag .remove-tag:hover {
    color: var(--color-danger);
}

.select-container input[type="text"] {
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-text-main);
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 0.3rem;
    flex-grow: 1;
    min-width: 150px;
}

/* Dropdown list for search matching */
.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    margin-top: 0.4rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: var(--shadow-md);
}

.dropdown-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #f1f5f9;
    transition: var(--transition);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
}

.dropdown-item .item-name {
    font-weight: 600;
    color: var(--color-text-main);
}

.dropdown-item .item-email {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.helper-text {
    font-size: 0.75rem;
    color: var(--color-text-light);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 0.5rem;
}

/* ==========================================================================
   Alerts & Notifications
   ========================================================================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid transparent;
}

.alert-info {
    background-color: rgba(18, 103, 118, 0.08);
    border-color: rgba(18, 103, 118, 0.15);
    color: #126776;
}

/* ==========================================================================
   Results Table & Controls
   ========================================================================== */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-header h2 {
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-count {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.results-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: #ffffff;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

th, td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f8fafc;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

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

tr:hover td {
    background-color: #f8fafc;
}

.meeting-title {
    font-weight: 700;
    color: var(--color-text-main);
}

.meeting-host {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: rgba(14, 40, 61, 0.08);
}

.empty-state p {
    font-size: 0.9rem;
}

.pill-count {
    background-color: #f1f5f9;
    color: var(--color-text-main);
    border: 1px solid #cbd5e1;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(14, 40, 61, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    transition: var(--transition);
}

.modal-content {
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #ffffff;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlide 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.max-w-lg {
    max-width: 600px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--color-text-light);
    font-size: 1.75rem;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

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

.modal-body {
    overflow-y: auto;
    padding-bottom: 1rem;
}

.text-area-copy {
    width: 100%;
    height: 250px;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--color-secondary);
    font-family: monospace;
    font-size: 0.75rem;
    resize: none;
    outline: none;
    margin: 1rem 0;
}

.instruction {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.copy-success {
    margin-left: 1rem;
    color: var(--color-success);
    font-size: 0.8rem;
    font-weight: 600;
}

@keyframes modalSlide {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================================================
   Toggle Switches
   ========================================================================== */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border: 1px solid #cbd5e1;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--color-accent);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Table Results Filters */
.table-filters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .table-filters {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 480px) {
    .table-filters {
        grid-template-columns: 1fr;
    }
}

.table-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.table-filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.table-filter-group input {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition);
}

.table-filter-group input:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 2px rgba(18, 103, 118, 0.1);
}

.table-filter-group.btn-align-bottom {
    justify-content: flex-end;
}

.table-filter-group.btn-align-bottom .btn {
    width: 100%;
}

/* ==========================================================================
   PRINT MEDIA RULES (Montserrat for printing)
   ========================================================================== */
@media print {
    body {
        background-color: #ffffff;
        color: #000000;
        font-family: var(--font-body);
        font-size: 10pt;
    }
    
    .app-container {
        display: block;
    }
    
    .sidebar, 
    .filters-section, 
    .results-header .results-actions,
    .btn,
    .modal,
    header.main-header .user-badge {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
        margin: 0;
        max-width: 100%;
    }
    
    .results-section {
        border: none;
        box-shadow: none;
        padding: 0;
    }
    
    .table-container {
        border: none;
    }
    
    table {
        width: 100%;
        border-collapse: collapse;
        font-size: 9pt;
    }
    
    th, td {
        padding: 6px 10px;
        border-bottom: 1px solid #000000 !important;
    }
    
    th {
        background-color: #f1f5f9 !important;
        color: #000000;
        font-weight: bold;
        border-bottom: 2px solid #000000 !important;
    }
    
    h1, h2, h3 {
        color: #000000;
        font-family: var(--font-headings);
    }
}
