/*
 * MuniMeet Design System 2025
 * "GovTech meets Silicon Valley"
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    /* Brand Colors - Bold & Confident */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;

    /* Accent Colors - Vibrant & Energetic */
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    --accent-orange: #f97316;
    --accent-green: #10b981;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;

    /* Gradients - Modern & Eye-catching */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-sunset: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-ocean: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-forest: linear-gradient(135deg, #0ba360 0%, #3cba92 100%);
    --gradient-fire: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-royal: linear-gradient(135deg, #667eea 0%, #f857a6 100%);

    /* Neutrals */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
    box-sizing: border-box;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--gray-50);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

/* Utility Classes */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-bg {
    background: var(--gradient-primary);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-hover {
    transition: all var(--transition-base);
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Button Styles */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition-base);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn-primary svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left var(--transition-base);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: var(--primary-600);
    border: 2px solid var(--primary-600);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition-base);
    cursor: pointer;
}

.btn-secondary svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-secondary:hover {
    background: var(--primary-50);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition-base);
    cursor: pointer;
}

.btn-danger svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-warning {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition-base);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

.btn-warning svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-warning:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--gray-600);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

.btn-icon:hover {
    background: var(--gray-100);
    color: var(--primary-600);
}

.btn-icon-danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-base);
    cursor: pointer;
    margin-bottom: 1rem;
}

.btn-back svg {
    width: 16px;
    height: 16px;
}

.btn-back:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-published {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
}

.badge-draft {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.3);
}

.badge-custom {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.badge-info {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.3);
}

/* Card Styles */
.card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.card-stat {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border-left: 4px solid transparent;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card-stat::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    opacity: 0.1;
    border-radius: 50%;
    transition: all var(--transition-base);
}

.card-stat:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-stat:hover::before {
    transform: scale(1.2);
    opacity: 0.15;
}

/* Icon Styles */
.icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    transition: all var(--transition-base);
}

.icon-wrapper:hover {
    transform: rotate(5deg) scale(1.1);
}

/* Form Styles */
.form-control, .form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    background: white;
}

.form-control:focus, .form-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.input-with-icon {
    padding-left: 3rem !important;
}

.login-form {
    margin-bottom: 2rem;
}

/* Board Icon SVG Styles */
.board-card-icon svg {
    width: 24px;
    height: 24px;
    color: white;
    stroke: currentColor;
    fill: none;
}

/* Table Styles */
.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead {
    background: var(--gray-50);
}

.table-modern th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
}

.table-modern td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    transition: background var(--transition-fast);
}

.table-modern tbody tr:hover td {
    background: var(--gray-50);
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Spinner for loading states */
.spinner {
    animation: spin 1s linear infinite;
    width: 1.125rem;
    height: 1.125rem;
}

/* Blazor Error Boundary */
.blazor-error-boundary {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-xl);
}

.blazor-error-boundary::after {
    content: "⚠️ An error has occurred. Please refresh the page.";
    font-weight: 600;
}

/* Validation */
.valid.modified:not([type=checkbox]) {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.validation-message {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

.modal-container {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-2xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--gray-500);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Modal Form Styles */
.modal-body .form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.modal-body .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-body .form-group-full {
    grid-column: 1 / -1;
}

.modal-body .form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0;
}

.modal-body .form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    transition: all var(--transition-fast);
    background: white;
}

.modal-body .form-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modal-body .form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
}

.modal-body .validation-summary {
    color: #ef4444;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #fee2e2;
    border-radius: 0.5rem;
    border-left: 4px solid #ef4444;
}

/* Responsive */
@media (max-width: 640px) {
    .card {
        padding: 1rem;
    }

    .btn-primary, .btn-secondary {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
    }

    .modal-container {
        max-height: 95vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}

/* Rich Text Editor */
.rich-text-editor-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.rich-text-editor-container .tox {
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.rich-text-editor-container .tox-statusbar {
    border-radius: 0 0 0.75rem 0.75rem;
}

.rich-text-editor-shell {
    width: 100%;
}

.rich-text-editor-textarea {
    width: 100%;
    min-height: 200px;
    border-radius: 0.75rem;
    border: 1px solid var(--gray-200);
    padding: 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
}

.rich-text-editor-container:focus-within .tox-tinymce {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    border-color: var(--primary-500);
}

/* Rich text display */
.agenda-item-description {
    font-size: 0.95rem;
    color: var(--gray-700);
    line-height: 1.6;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.agenda-item-description p {
    margin: 0 0 0.75rem 0;
}

.agenda-item-description ul,
.agenda-item-description ol {
    margin: 0.25rem 0 0.75rem 1.5rem;
    padding-left: 1rem;
}

.agenda-item-description ul {
    list-style: disc;
}

.agenda-item-description ol {
    list-style: decimal;
}

.agenda-item-description li {
    margin-bottom: 0.35rem;
}

.agenda-item-description table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin: 0.75rem 0;
    font-size: 0.95rem;
}

.agenda-item-description th,
.agenda-item-description td {
    border: 1px solid var(--gray-200);
    padding: 0.5rem 0.75rem;
}

.agenda-item-description blockquote {
    border-left: 4px solid var(--primary-200);
    background: var(--gray-50);
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;
    color: var(--gray-600);
    font-style: italic;
}

/* Table border visualization - show dashed borders for tables with border="0" in UI only */
.agenda-item-description table[border="0"] {
    border-collapse: collapse;
}

.agenda-item-description table[border="0"] td,
.agenda-item-description table[border="0"] th {
    border: 1px dashed var(--gray-300) !important;
}

/* Public meeting agenda description - same styling as internal agenda items */
.public-meeting-agenda-description p {
    margin: 0 0 0.75rem 0;
}

.public-meeting-agenda-description ul,
.public-meeting-agenda-description ol {
    margin: 0.25rem 0 0.75rem 1.5rem;
    padding-left: 1rem;
}

.public-meeting-agenda-description ul {
    list-style: disc;
}

.public-meeting-agenda-description ol {
    list-style: upper-alpha;
}

.public-meeting-agenda-description li {
    margin-bottom: 0.35rem;
}

/* Public meeting metadata - same styling */
.public-meeting-agenda-metadata p {
    margin: 0 0 0.5rem 0;
}

.public-meeting-agenda-metadata ul,
.public-meeting-agenda-metadata ol {
    margin: 0.25rem 0 0.5rem 1.5rem;
    padding-left: 1rem;
}

.public-meeting-agenda-metadata ul {
    list-style: disc;
}

.public-meeting-agenda-metadata ol {
    list-style: decimal;
}

.public-meeting-agenda-metadata li {
    margin-bottom: 0.25rem;
}

/* Rich text display */

/* Empty State - Shared across Meetings, Boards, Templates */
.empty-state {
    background: white;
    border: 2px dashed var(--gray-200);
    border-radius: 1rem;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state .empty-icon svg {
    width: 4rem;
    height: 4rem;
    color: var(--gray-300);
    margin: 0 auto 1.5rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-600);
    margin-bottom: 2rem;
}

.empty-state .btn-primary {
    padding: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    line-height: 1;
    vertical-align: middle;
}

/* Empty State Small Variant - Used within cards/sections */
.empty-state-small {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    border-radius: 12px;
}

.empty-state-small .empty-icon-small svg {
    width: 3rem;
    height: 3rem;
    color: var(--gray-400);
    margin: 0 auto 1rem;
}

.empty-state-small h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.empty-state-small p {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}