/* Global Styles for DBA-TBD-APP Calendar Manager */

/* ===== LAYOUT ===== */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-body);
}

body.app-page {
    background: var(--bg-body);
    min-height: 100vh;
}

main {
    flex: 1;
    padding: var(--space-xl) 0;
}

.container-fluid {
    max-width: 1400px;
}

/* ===== NAVIGATION OVERRIDES ===== */
.navbar {
    border-bottom: none;
}

.navbar-dark {
    background: var(--bg-card-translucent) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.navbar-dark .navbar-brand,
.navbar-dark .nav-link {
    color: var(--text-primary) !important;
}

.navbar-dark .nav-link:hover {
    color: var(--text-primary) !important;
    background-color: var(--bg-hover);
    border-radius: var(--radius-md);
}

.navbar-dark .nav-link.active {
    background: var(--primary-gradient);
    color: var(--text-white) !important;
    border-radius: var(--radius-md);
}

/* Add spacing between nav items */
.navbar-nav .nav-item {
    margin-right: var(--space-sm);
}

.navbar-nav .nav-item:last-child {
    margin-right: 0;
}

/* Add extra spacing for dropdown nav items */
.navbar-nav .nav-item.dropdown {
    margin-right: var(--space-md);
}

.navbar-toggler {
    border-color: var(--border-default);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2874, 69, 104, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* User Info in Navbar */
.navbar-text {
    color: var(--text-secondary);
}

.navbar-text .member-avatar {
    margin-left: var(--space-sm);
}

/* ===== MAIN CONTAINER OVERRIDE ===== */
/* Override Bootstrap's my-4 class that adds excessive top/bottom margins */
main.container {
    margin-top: 0 !important;                   /* ← No top spacing from nav */
    margin-bottom: var(--space-lg) !important;  /* ← Controlled bottom spacing */
    padding-top: 0 !important;                  /* ← No top padding */
}

/* ===== PAGE HEADERS ===== */
.page-header {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-xl) var(--space-2xl);  /* ← More internal padding: 24px top/bottom, 30px sides */
    margin-top: var(--space-sm);                /* ← Minimal top margin for spacing from nav */
    margin-bottom: var(--space-xl);             /* ← Consistent spacing to content sections */
    box-shadow: var(--shadow-sm);
}

.page-header h1 {
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.page-header .lead {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* ===== STATS CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    border: 1px solid var(--border-default);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card-primary {
    background: var(--primary-gradient);
    color: var(--text-white);
    border: none;
}

.stat-card-success {
    background: var(--success-gradient);
    color: var(--text-white);
    border: none;
}

.stat-card-warning {
    background: var(--warning-gradient);
    color: var(--text-primary);
    border: none;
}

.stat-card h3 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-xs);
}

.stat-card p {
    margin: 0;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    opacity: 0.9;
}

/* ===== MEMBER COMPONENTS ===== */
/* Member card styles moved to components/member-card.css for better organization */

.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-lg);
}

/* ===== MEETING COMPONENTS ===== */
.meeting-card {
    margin-bottom: var(--space-lg);
}

.meeting-type-badge {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
}

.meeting-info {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.meeting-info-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
}

.meeting-info-item i {
    color: var(--primary-color);
}

/* ===== INVITATION STATUS ===== */
.invitation-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.invitation-stat {
    text-align: center;
    padding: var(--space-md);
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
}

.invitation-stat h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: var(--font-size-2xl);
}

.invitation-stat small {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: var(--font-size-xs);
}

/* ===== SYNC STATUS COMPONENTS ===== */
.sync-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.sync-status.synced {
    background: linear-gradient(135deg, var(--success-bg-light), rgba(56, 161, 105, 0.1));
    border: 1px solid var(--success-color);
}

.sync-status.unsynced {
    background: linear-gradient(135deg, var(--secondary-bg-light), rgba(90, 98, 104, 0.1));
    border: 1px solid var(--text-muted);
}

/* ===== CALENDAR SELECT ===== */
.calendar-select-container {
    max-width: 600px;
    margin: 0 auto;
}

.calendar-option {
    padding: var(--space-lg);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.calendar-option:hover {
    border-color: var(--primary-color);
    background: var(--bg-hover);
}

.calendar-option.selected {
    border-color: var(--primary-color);
    background: var(--bg-selected);
}

/* ===== ACTION BUTTONS GROUP ===== */
.action-buttons {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.action-buttons .btn {
    flex: 1;
    min-width: 150px;
}

/* ===== EMPTY STATES ===== */
.empty-state {
    text-align: center;
    padding: var(--space-3xl);
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
    opacity: 0.3;
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

/* ===== LOADING STATES ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ===== RESPONSIVE TABLES ===== */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: var(--radius-lg);
        border: 1px solid var(--border-default);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}

/* ===== UTILITIES ===== */
.mb-section {
    margin-bottom: var(--space-3xl);
}

.text-primary-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Override Bootstrap's default focus styles */
.btn:focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: var(--primary-color);
    color: var(--text-white);
}

::-moz-selection {
    background: var(--primary-color);
    color: var(--text-white);
}