/*
 * CrowdVote Site-wide Styles
 * 
 * This file contains common styles used across all pages of the CrowdVote application.
 * It should be loaded after Tailwind CSS but before page-specific CSS files.
 * 
 * TODO: In a future change, consolidate repetitive CSS from templates into this file.
 * Look for common patterns in:
 * - Panel/card styles (bg-white dark:bg-gray-800 rounded-lg shadow-sm, etc.)
 * - Button styles (primary, secondary, danger, etc.)
 * - Typography (headings, body text, etc.)
 * - Dark mode utilities
 * - Layout helpers (spacing, containers, etc.)
 * - Form elements (inputs, selects, etc.)
 * - Status badges (active, closed, draft, etc.)
 * 
 * This consolidation will reduce template bloat and ensure consistent styling
 * across the entire application.
 */

/* ===== Modal Styles ===== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    animation: fadeIn 0.2s ease-in-out;
}

.dark .modal-backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.modal-dialog {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 32rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.2s ease-in-out;
}

.dark .modal-dialog {
    background: #1f2937;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.dark .modal-header {
    border-bottom-color: #374151;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.dark .modal-title {
    color: #f9fafb;
}

.modal-close {
    font-size: 2rem;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #111827;
}

.dark .modal-close:hover {
    color: #f9fafb;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.dark .modal-footer {
    border-top-color: #374151;
}

/* ===== Tag Pills (Modal) ===== */
.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: #3b82f6;
    color: white;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.tag-pill-remove {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.7;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0 0.25rem;
}

.tag-pill-remove:hover {
    opacity: 1;
}

.dark .tag-pill {
    background: #2563eb;
}

.tag-suggestion {
    cursor: pointer;
    opacity: 0.7;
}

.tag-suggestion:hover {
    opacity: 1;
    background: #2563eb;
    transform: translateY(-1px);
}

/* ===== Tag Pills (Small, in Tables) ===== */
.tag-pill-small {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    margin-right: 0.25rem;
    margin-bottom: 0.125rem;
    background: #3b82f6;
    color: white;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.dark .tag-pill-small {
    background: #2563eb;
}

.following-all-tags {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    background: #10b981;
    color: white;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dark .following-all-tags {
    background: #059669;
}

/* ===== Button Styles ===== */
.btn-primary {
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.dark .btn-secondary {
    background: #374151;
    color: #f3f4f6;
    border-color: #4b5563;
}

.dark .btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    padding: 0.5rem 1rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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