/* Global Design System - Blue Theme */
:root {
    /* Color Palette - Blue (Primary) */
    --primary-color: #2563eb;       /* blue-600 */
    --primary-hover: #1d4ed8;       /* blue-700 */
    --primary-light: #eff6ff;       /* blue-50 */
    --primary-border: #bfdbfe;      /* blue-200 */
    --primary-text: #1e40af;        /* blue-800 */
    
    /* Surface & Text */
    --surface-color: #ffffff;
    --background-color: #f8f9fa;
    --text-main: #1f2937;           /* gray-800 */
    --text-muted: #6b7280;          /* gray-500 */
    
    /* Functional Colors */
    --danger-color: #dc2626;        /* red-600 */
    --success-color: #059669;       /* emerald-600 (kept for specific success states if needed, though theme is blue) */
    
    /* Typography */
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Spacing & Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

body { 
    font-family: var(--font-main); 
    background-color: var(--background-color); 
    color: var(--text-main); 
}

.mono { font-family: var(--font-mono); }

/* --- Components --- */

/* Card */
.card {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb; /* gray-200 */
    overflow: hidden;
}

/* Section Header */
.section-header {
    font-size: 1.25rem; /* text-xl */
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Pulse Indicator (Blue) */
.pulse-indicator {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background-color: var(--primary-color);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem; /* text-xs */
    font-weight: 700;
    text-transform: uppercase;
}
.badge-blue { background-color: var(--primary-light); color: var(--primary-color); }
.badge-gray { background-color: #f3f4f6; color: var(--text-muted); font-family: var(--font-mono); }

/* Table Styles */
.table-container {
    overflow-x: auto;
}
.table-base {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
}
.table-base th {
    padding: 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid #e5e7eb;
}
.table-base td {
    padding: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}
.table-base tr:last-child td { border-bottom: none; }
.table-base tr:hover { background-color: #f9fafb; }

/* Vote Button Refined for Blue Theme */
.btn-vote-base {
    width: 6rem; 
    padding: 0.375rem 0;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border: 1px solid transparent;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Voted State (Active Blue) */
.btn-vote-voted {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    position: relative;
    overflow: hidden;
}
.btn-vote-voted:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}
.btn-vote-voted .unvote-text { display: none; }
.btn-vote-voted:hover .selected-text { display: none; }
.btn-vote-voted:hover .unvote-text { display: inline; }

/* Vote Action State (Neutral with Blue Hover) */
.btn-vote-action {
    background-color: white;
    color: var(--text-main);
    border-color: #d1d5db;
}
.btn-vote-action:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

/* Disabled State */
.btn-vote-disabled {
    background-color: #f9fafb;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}


/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background-color: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    z-index: 40;
}
.fab:hover { transform: scale(1.1); background-color: #333; }

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    z-index: 50;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 15px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    transition: transform 0.3s;
}
.modal-overlay.open .modal-content { transform: translateY(0); }

/* Vote Button Component (Extracted from voting.js) */
.btn-vote-base {
    width: 6rem; /* w-24 */
    padding-top: 0.375rem;
    padding-bottom: 0.375rem; /* py-1.5 */
    border-radius: 0.25rem; /* rounded */
    font-size: 0.75rem; /* text-xs */
    font-weight: 700; /* font-bold */
    text-transform: uppercase;
    letter-spacing: 0.025em; /* tracking-wide */
    border-width: 1px;
    border-style: solid;
    transition: all 0.2s;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Voted State (Active) */
.btn-vote-voted {
    background-color: #10b981; /* bg-emerald-500 */
    color: white;
    border-color: #10b981;
    position: relative;
    overflow: hidden;
}
.btn-vote-voted:hover {
    background-color: #047857; /* bg-emerald-700 */
    border-color: #047857;
    color: white;
}
.btn-vote-voted .unvote-text { display: none; }
.btn-vote-voted:hover .selected-text { display: none; }
.btn-vote-voted:hover .unvote-text { display: inline; }

/* Vote Action State (Default) */
.btn-vote-action {
    background-color: white;
    color: #374151; /* text-gray-700 */
    border-color: #d1d5db; /* border-gray-300 */
}
.btn-vote-action:hover {
    color: #059669; /* text-emerald-600 */
    border-color: #10b981; /* border-emerald-500 */
    background-color: #ecfdf5; /* bg-emerald-50 */
}

/* Disabled/Max Limit State */
.btn-vote-disabled {
    background-color: #f9fafb; /* bg-gray-50 */
    color: #9ca3af; /* text-gray-400 */
    border-color: #e5e7eb; /* border-gray-200 */
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

/* Login Placeholder */
.login-placeholder {
    font-size: 0.75rem;
    color: #9ca3af;
    display: block;
    width: 6rem;
    text-align: right;
}
