/**
 * NoticeBoard Pro - Main Stylesheet
 * Mobile-first responsive design with 25 templates
 */

/* CSS Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --light: #f8fafc;
    --dark: #1e293b;
    --white: #ffffff;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --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);
    --transition: 0.2s ease;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--gray-100);
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    font-weight: 600;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Buttons - Touch-friendly min 44px */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    min-height: 36px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-lg {
    min-height: 52px;
    padding: 0.875rem 1.75rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
    background: transparent;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}

.btn-icon:hover {
    background: var(--gray-100);
}

.btn-icon.btn-danger {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}

.btn-icon.btn-danger:hover {
    background: var(--danger);
    color: var(--white);
}

/* Download Button - Modern gradient style */
.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 48px;
    padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-download::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-download:hover::before {
    left: 100%;
}

.btn-download:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    text-decoration: none;
    color: #fff;
}

.btn-download:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

.btn-download svg {
    flex-shrink: 0;
    animation: bounce-down 2s ease-in-out infinite;
}

@keyframes bounce-down {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    transition: border-color var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}

select {
    cursor: pointer;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Auth Page */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--gray-500);
}

.auth-form h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    font-size: 0.875rem;
}

/* Header */
.main-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    gap: 1rem;
}

.header-content h1 {
    font-size: 1.25rem;
    color: var(--primary);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    display: none;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.header-back {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--gray-600);
    font-weight: 500;
}

.header-back:hover {
    color: var(--primary);
    text-decoration: none;
}

/* Dashboard */
.dashboard-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.dashboard-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dashboard-header h2 {
    color: var(--gray-800);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--gray-300);
}

.empty-state svg {
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* Boards Grid */
.boards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.board-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition);
}

.board-card:hover {
    box-shadow: var(--shadow-md);
}

.board-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.board-card-header h3 {
    color: var(--gray-800);
    word-break: break-word;
}

.notice-count {
    background: var(--gray-100);
    color: var(--gray-600);
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    white-space: nowrap;
}

.board-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.board-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.inline-form {
    display: inline;
}

/* Create Board */
.create-board-main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.create-board-form {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h2 {
    margin-bottom: 0.5rem;
    color: var(--gray-800);
}

.section-desc {
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.template-option {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem;
    cursor: pointer;
    transition: all var(--transition);
}

.template-option:hover {
    border-color: var(--gray-400);
}

.template-option.selected {
    border-color: var(--primary);
    background: #eff6ff;
}

.template-preview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 0.5rem;
    background: var(--gray-100);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    aspect-ratio: 4/3;
}

.preview-box {
    background: var(--gray-300);
    border-radius: 2px;
}

.template-info {
    text-align: center;
}

.template-info strong {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-800);
    margin-bottom: 0.125rem;
}

.template-info span {
    font-size: 0.625rem;
    color: var(--gray-500);
}

/* Manage Board */
.manage-board-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.board-info-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.75rem 1rem;
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Notices List */
.notices-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notice-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: grab;
    transition: all var(--transition);
}

.notice-item:active {
    cursor: grabbing;
}

.notice-item.dragging {
    opacity: 0.5;
    transform: scale(1.02);
}

.notice-drag-handle {
    color: var(--gray-400);
    flex-shrink: 0;
    touch-action: none;
}

.notice-content {
    flex: 1;
    min-width: 0;
}

.notice-content h4 {
    color: var(--gray-800);
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.notice-text-preview {
    font-size: 0.875rem;
    color: var(--gray-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-pdf-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--primary);
    margin-top: 0.25rem;
}

.notice-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Notice Colors */
.notice-red, .notice-item.notice-red {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
}

.notice-blue, .notice-item.notice-blue {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
}

.notice-green, .notice-item.notice-green {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
}

.notice-orange, .notice-item.notice-orange {
    background: #fff7ed;
    border-left: 4px solid #f97316;
}

.notice-purple, .notice-item.notice-purple {
    background: #faf5ff;
    border-left: 4px solid #a855f7;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 700px;
}

.modal-fullscreen {
    max-width: 95vw;
    max-height: 95vh;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    color: var(--gray-800);
}

.modal-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--gray-500);
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: 1.25rem;
}

/* Rich Editor */
.editor-toolbar {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
}

.editor-toolbar button {
    min-width: 36px;
    min-height: 36px;
    padding: 0.25rem 0.5rem;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

.editor-toolbar button:hover {
    background: var(--gray-200);
}

.rich-editor {
    min-height: 150px;
    padding: 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--white);
    overflow-y: auto;
}

.rich-editor:focus {
    outline: none;
    border-color: var(--primary);
}

/* Current File Display */
.current-file {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--gray-100);
    border-radius: var(--radius);
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* Embed Textarea */
.embed-textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    font-family: monospace;
    font-size: 0.875rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    resize: vertical;
}


/* ========================================
   EMBED STYLES
   ======================================== */

.embed-body {
    background: var(--gray-100);
}

.embed-container {
    min-height: 100vh;
}

.board-header-embed {
    padding: 1rem;
    margin-bottom: 1rem;
}

.board-header-embed h2 {
    color: var(--gray-800);
    font-size: 1.5rem;
}

.embed-empty {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

/* Notices Grid - Base */
.notices-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 1rem 1rem;
}

/* Notice Card */
.notice-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}

.notice-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.notice-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
}

.notice-card-header h3 {
    color: var(--gray-800);
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.notice-date {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.notice-card-content {
    padding: 1rem 1.25rem;
    color: var(--gray-700);
    line-height: 1.7;
}

.notice-card-content ul,
.notice-card-content ol {
    margin-left: 1.25rem;
}

/* Notice Card Colors - WCAG AA Compliant */
.notice-card.notice-red {
    border-top: 4px solid #dc2626;
    background: linear-gradient(to bottom, #fef2f2 0%, var(--white) 100%);
}

.notice-card.notice-red .notice-card-header h3 {
    color: #991b1b;
}

.notice-card.notice-blue {
    border-top: 4px solid #2563eb;
    background: linear-gradient(to bottom, #eff6ff 0%, var(--white) 100%);
}

.notice-card.notice-blue .notice-card-header h3 {
    color: #1e40af;
}

.notice-card.notice-green {
    border-top: 4px solid #16a34a;
    background: linear-gradient(to bottom, #f0fdf4 0%, var(--white) 100%);
}

.notice-card.notice-green .notice-card-header h3 {
    color: #166534;
}

.notice-card.notice-orange {
    border-top: 4px solid #ea580c;
    background: linear-gradient(to bottom, #fff7ed 0%, var(--white) 100%);
}

.notice-card.notice-orange .notice-card-header h3 {
    color: #9a3412;
}

.notice-card.notice-purple {
    border-top: 4px solid #9333ea;
    background: linear-gradient(to bottom, #faf5ff 0%, var(--white) 100%);
}

.notice-card.notice-purple .notice-card-header h3 {
    color: #6b21a8;
}

/* PDF Section */
.notice-pdf-section {
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
}

.pdf-preview {
    margin-bottom: 1rem;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-200);
    position: relative;
}

.pdf-iframe {
    width: 100%;
    height: 300px;
    border: none;
    display: block;
}

.pdf-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #666;
    pointer-events: none;
}

.pdf-preview:hover .pdf-overlay {
    opacity: 1;
    background: rgba(255,255,255,0.9);
}

.pdf-overlay svg {
    margin-bottom: 8px;
    color: #667eea;
}

.pdf-overlay span {
    font-size: 14px;
    font-weight: 500;
}

.pdf-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-view-pdf {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #f0f0f0;
    color: #333;
    border-radius: 50px;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
}

.btn-view-pdf:hover {
    background: #e0e0e0;
    text-decoration: none;
}

/* ========================================
   25 TEMPLATE VARIATIONS
   ======================================== */

/* Template 1: 1-Column Classic */
.template-1 .notices-grid {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
}

/* Template 2: 2-Column Grid */
.template-2 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Template 3: 3-Column Grid */
.template-3 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Template 4: 4-Column Grid */
.template-4 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.template-4 .notice-card {
    font-size: 0.9rem;
}

/* Template 5: Card Style Blue */
.template-5 {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

.template-5 .board-header-embed h2 {
    color: var(--white);
}

.template-5 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.template-5 .notice-card {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Template 6: Card Style Green */
.template-6 {
    background: linear-gradient(135deg, #14532d 0%, #22c55e 100%);
}

.template-6 .board-header-embed h2 {
    color: var(--white);
}

.template-6 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.template-6 .notice-card {
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Template 7: Card Style Red */
.template-7 {
    background: linear-gradient(135deg, #7f1d1d 0%, #ef4444 100%);
}

.template-7 .board-header-embed h2 {
    color: var(--white);
}

.template-7 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.template-7 .notice-card {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Template 8: Card Style Orange */
.template-8 {
    background: linear-gradient(135deg, #7c2d12 0%, #f97316 100%);
}

.template-8 .board-header-embed h2 {
    color: var(--white);
}

.template-8 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Template 9: Minimal Light */
.template-9 {
    background: #fafafa;
}

.template-9 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.template-9 .notice-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    box-shadow: none;
    border-radius: 4px;
}

.template-9 .notice-card:hover {
    box-shadow: var(--shadow);
}

/* Template 10: Minimal Dark */
.template-10 {
    background: #0f172a;
}

.template-10 .board-header-embed h2 {
    color: #e2e8f0;
}

.template-10 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.template-10 .notice-card {
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
}

.template-10 .notice-card-header h3 {
    color: #f1f5f9;
}

.template-10 .notice-card-content {
    color: #cbd5e1;
}

.template-10 .notice-date {
    color: #64748b;
}

/* Template 11: Corporate Blue */
.template-11 {
    background: #f0f9ff;
}

.template-11 .board-header-embed {
    background: #1e40af;
    margin: 0 0 1.5rem 0;
    padding: 1.5rem;
}

.template-11 .board-header-embed h2 {
    color: var(--white);
}

.template-11 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.template-11 .notice-card {
    border-left: 4px solid #1e40af;
}

/* Template 12: Corporate Gray */
.template-12 {
    background: #f8fafc;
}

.template-12 .board-header-embed {
    background: #374151;
    margin: 0 0 1.5rem 0;
    padding: 1.5rem;
}

.template-12 .board-header-embed h2 {
    color: var(--white);
}

.template-12 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.template-12 .notice-card {
    border-left: 4px solid #374151;
}

/* Template 13: Vibrant Purple */
.template-13 {
    background: linear-gradient(180deg, #581c87 0%, #a855f7 100%);
    min-height: 100vh;
}

.template-13 .board-header-embed h2 {
    color: var(--white);
}

.template-13 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.template-13 .notice-card {
    background: rgba(255,255,255,0.95);
    border-top: 4px solid #a855f7;
}

/* Template 14: Vibrant Teal */
.template-14 {
    background: linear-gradient(180deg, #134e4a 0%, #14b8a6 100%);
}

.template-14 .board-header-embed h2 {
    color: var(--white);
}

.template-14 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.template-14 .notice-card {
    background: rgba(255,255,255,0.95);
    border-top: 4px solid #14b8a6;
}

/* Template 15: Masonry Style */
.template-15 .notices-grid {
    display: block;
    column-count: 1;
    column-gap: 1rem;
}

.template-15 .notice-card {
    break-inside: avoid;
    margin-bottom: 1rem;
}

/* Template 16: List View */
.template-16 .notices-grid {
    grid-template-columns: 1fr;
    max-width: 900px;
    margin: 0 auto;
    gap: 0.5rem;
}

.template-16 .notice-card {
    border-radius: var(--radius);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.template-16 .notice-card-header {
    flex: 1;
    border-bottom: none;
    min-width: 200px;
}

.template-16 .notice-card-content {
    flex: 2;
    min-width: 200px;
}

/* Template 17: Magazine Style */
.template-17 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.template-17 .notice-card:first-child {
    grid-column: 1 / -1;
}

.template-17 .notice-card:first-child .notice-card-header h3 {
    font-size: 1.5rem;
}

/* Template 18: Bulletin Board */
.template-18 {
    background: #92400e url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect fill="%23a16207" width="100" height="100"/><circle fill="%2378350f" cx="25" cy="25" r="2"/><circle fill="%2378350f" cx="75" cy="75" r="2"/></svg>');
}

.template-18 .board-header-embed h2 {
    color: #fef3c7;
}

.template-18 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.template-18 .notice-card {
    background: #fffbeb;
    transform: rotate(-1deg);
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
}

.template-18 .notice-card:nth-child(even) {
    transform: rotate(1deg);
}

.template-18 .notice-card:hover {
    transform: rotate(0) scale(1.02);
}

/* Template 19: Neon Dark */
.template-19 {
    background: #030712;
}

.template-19 .board-header-embed h2 {
    color: #22d3ee;
    text-shadow: 0 0 10px #22d3ee;
}

.template-19 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.template-19 .notice-card {
    background: #111827;
    border: 1px solid #22d3ee;
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.2);
}

.template-19 .notice-card-header h3 {
    color: #22d3ee;
}

.template-19 .notice-card-content {
    color: #9ca3af;
}

.template-19 .notice-date {
    color: #4b5563;
}

/* Template 20: Pastel Soft */
.template-20 {
    background: linear-gradient(135deg, #fce7f3 0%, #dbeafe 50%, #d1fae5 100%);
}

.template-20 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.template-20 .notice-card {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.5);
}

/* Template 21: High Contrast (Accessibility) */
.template-21 {
    background: #000000;
}

.template-21 .board-header-embed h2 {
    color: #ffffff;
    font-size: 2rem;
}

.template-21 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.template-21 .notice-card {
    background: #ffffff;
    border: 3px solid #000000;
    border-radius: 0;
}

.template-21 .notice-card-header h3 {
    color: #000000;
    font-size: 1.25rem;
}

.template-21 .notice-card-content {
    color: #000000;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Template 22: Gradient Modern */
.template-22 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.template-22 .board-header-embed h2 {
    color: var(--white);
}

.template-22 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.template-22 .notice-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.9) 100%);
    border: none;
}

/* Template 23: Bordered Classic */
.template-23 {
    background: #fafaf9;
}

.template-23 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.template-23 .notice-card {
    background: var(--white);
    border: 2px solid #292524;
    border-radius: 0;
    box-shadow: 4px 4px 0 #292524;
}

.template-23 .notice-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #292524;
}

/* Template 24: Shadow Cards */
.template-24 {
    background: #f1f5f9;
}

.template-24 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.template-24 .notice-card {
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.template-24 .notice-card:hover {
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

/* Template 25: Compact Dense */
.template-25 .notices-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
}

.template-25 .notice-card {
    border-radius: 4px;
    font-size: 0.875rem;
}

.template-25 .notice-card-header {
    padding: 0.75rem;
}

.template-25 .notice-card-header h3 {
    font-size: 0.9rem;
}

.template-25 .notice-card-content {
    padding: 0.5rem 0.75rem 0.75rem;
}

.template-25 .pdf-iframe {
    height: 200px;
}


/* ========================================
   RESPONSIVE MEDIA QUERIES
   Mobile-first approach down to 320px
   ======================================== */

/* Small phones (320px and up) */
@media (min-width: 320px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Larger phones (375px and up) */
@media (min-width: 375px) {
    .auth-container {
        padding: 2.5rem;
    }
    
    .boards-grid {
        gap: 1.25rem;
    }
}

/* Tablets (600px and up) */
@media (min-width: 600px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    
    .user-email {
        display: block;
    }
    
    .boards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .templates-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .notices-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .template-15 .notices-grid {
        column-count: 2;
    }
    
    .notice-item {
        padding: 1.25rem;
    }
}

/* Small desktops (900px and up) */
@media (min-width: 900px) {
    .header-content {
        padding: 0 1.5rem;
    }
    
    .dashboard-main,
    .manage-board-main {
        padding: 2rem;
    }
    
    .boards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .templates-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .notices-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .template-15 .notices-grid {
        column-count: 3;
    }
    
    .template-4 .notices-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Large desktops (1200px and up) */
@media (min-width: 1200px) {
    .boards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .templates-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .notices-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .template-15 .notices-grid {
        column-count: 4;
    }
    
    .template-1 .notices-grid {
        grid-template-columns: 1fr;
    }
    
    .template-16 .notices-grid {
        grid-template-columns: 1fr;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 48px;
    }
    
    .btn-icon {
        min-width: 48px;
        min-height: 48px;
    }
    
    .btn-download {
        min-height: 52px;
        padding: 1rem 1.5rem;
    }
    
    .notice-item {
        padding: 1rem 0.75rem;
    }
    
    .notice-drag-handle {
        padding: 0.5rem;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .main-header,
    .btn,
    .notice-actions,
    .board-card-actions,
    .modal {
        display: none !important;
    }
    
    .notice-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    body {
        background: white;
    }
}

/* ========================================
   TEMPLATE PREVIEW STYLES (Create Board)
   ======================================== */

.template-preview.template-1 {
    grid-template-columns: 1fr;
}

.template-preview.template-2 {
    grid-template-columns: repeat(2, 1fr);
}

.template-preview.template-3 {
    grid-template-columns: repeat(3, 1fr);
}

.template-preview.template-4 {
    grid-template-columns: repeat(4, 1fr);
}

.template-preview.template-5 {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

.template-preview.template-5 .preview-box {
    background: white;
}

.template-preview.template-6 {
    background: linear-gradient(135deg, #14532d 0%, #22c55e 100%);
}

.template-preview.template-6 .preview-box {
    background: white;
}

.template-preview.template-7 {
    background: linear-gradient(135deg, #7f1d1d 0%, #ef4444 100%);
}

.template-preview.template-7 .preview-box {
    background: white;
}

.template-preview.template-8 {
    background: linear-gradient(135deg, #7c2d12 0%, #f97316 100%);
}

.template-preview.template-8 .preview-box {
    background: white;
}

.template-preview.template-9 {
    background: #fafafa;
}

.template-preview.template-9 .preview-box {
    background: white;
    border: 1px solid #e5e5e5;
}

.template-preview.template-10 {
    background: #0f172a;
}

.template-preview.template-10 .preview-box {
    background: #1e293b;
}

.template-preview.template-11 {
    background: #f0f9ff;
}

.template-preview.template-11 .preview-box {
    background: white;
    border-left: 2px solid #1e40af;
}

.template-preview.template-12 {
    background: #f8fafc;
}

.template-preview.template-12 .preview-box {
    background: white;
    border-left: 2px solid #374151;
}

.template-preview.template-13 {
    background: linear-gradient(180deg, #581c87 0%, #a855f7 100%);
}

.template-preview.template-13 .preview-box {
    background: white;
}

.template-preview.template-14 {
    background: linear-gradient(180deg, #134e4a 0%, #14b8a6 100%);
}

.template-preview.template-14 .preview-box {
    background: white;
}

.template-preview.template-15 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
}

.template-preview.template-15 .preview-box:first-child {
    grid-row: span 2;
}

.template-preview.template-16 {
    grid-template-columns: 1fr;
    gap: 2px;
}

.template-preview.template-16 .preview-box {
    height: 12px;
}

.template-preview.template-17 {
    grid-template-columns: repeat(2, 1fr);
}

.template-preview.template-17 .preview-box:first-child {
    grid-column: span 2;
}

.template-preview.template-18 {
    background: #92400e;
}

.template-preview.template-18 .preview-box {
    background: #fffbeb;
    transform: rotate(-2deg);
}

.template-preview.template-18 .preview-box:nth-child(even) {
    transform: rotate(2deg);
}

.template-preview.template-19 {
    background: #030712;
}

.template-preview.template-19 .preview-box {
    background: #111827;
    border: 1px solid #22d3ee;
}

.template-preview.template-20 {
    background: linear-gradient(135deg, #fce7f3 0%, #dbeafe 50%, #d1fae5 100%);
}

.template-preview.template-20 .preview-box {
    background: rgba(255,255,255,0.8);
}

.template-preview.template-21 {
    background: #000000;
}

.template-preview.template-21 .preview-box {
    background: white;
    border: 2px solid black;
}

.template-preview.template-22 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.template-preview.template-22 .preview-box {
    background: white;
}

.template-preview.template-23 {
    background: #fafaf9;
}

.template-preview.template-23 .preview-box {
    background: white;
    border: 1px solid #292524;
    box-shadow: 2px 2px 0 #292524;
}

.template-preview.template-24 {
    background: #f1f5f9;
}

.template-preview.template-24 .preview-box {
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.template-preview.template-25 {
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.template-preview.template-25 .preview-box {
    border-radius: 1px;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}
