/**
 * TTPA Transparency Portal - Stylesheet
 * Minimal, accessible CSS for transparency card display
 */

/* ========================================================================
   Reset and Base Styles
   ======================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #2

;
    background: #f5f5f5;
    padding: 1rem;
}

/* ========================================================================
   Typography
   ======================================================================== */

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 {
    font-size: 2rem;
    color: #1a1a1a;
}

h2 {
    font-size: 1.5rem;
    color: #2c2c2c;
    margin-top: 2rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.25rem;
    color: #3c3c3c;
}

p {
    margin-bottom: 1rem;
}

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code {
    background: #f0f0f0;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: "Monaco", "Courier New", monospace;
    font-size: 0.9em;
}

small {
    font-size: 0.875rem;
    color: #666;
}

/* ========================================================================
   Layout
   ======================================================================== */

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }

    .container {
        padding: 1rem;
        border-radius: 4px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }
}

/* ========================================================================
   Transparency Card (Public View)
   ======================================================================== */

.transparency-card {
    margin: 0;
}

.card-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #0066cc;
}

.card-subtitle {
    color: #666;
    font-size: 1rem;
    margin-top: 0.5rem;
}

.card-section {
    margin-bottom: 2.5rem;
}

.political-ad-notice {
    margin-bottom: 2rem;
}

.notice-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 6px;
    padding: 1.5rem;
    text-align: center;
}

.notice-box h2 {
    color: #856404;
    border: none;
    margin: 0 0 0.5rem 0;
    padding: 0;
}

.notice-box p {
    color: #856404;
    margin: 0;
}

/* Definition lists for structured data */
dl {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 0.75rem 1.5rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    dl {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    dt {
        font-weight: bold;
        margin-top: 1rem;
    }

    dt:first-child {
        margin-top: 0;
    }
}

dt {
    font-weight: 600;
    color: #555;
}

dd {
    color: #2c2c2c;
}

.card-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e0e0e0;
    text-align: center;
    color: #666;
}

/* ========================================================================
   Admin Area
   ======================================================================== */

.admin-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #0066cc;
}

.admin-header h1 {
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #666;
    font-size: 1rem;
}

.admin-nav {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ========================================================================
   Forms
   ======================================================================== */

fieldset {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

legend {
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0 0.5rem;
    color: #0066cc;
}

.fieldset-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.form-group-grow {
    flex: 1;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #2c2c2c;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

textarea {
    resize: vertical;
}

input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.form-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e0e0e0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ========================================================================
   Buttons
   ======================================================================== */

.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #0066cc;
    color: white;
}

.btn-primary:hover {
    background: #0052a3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    text-decoration: none;
}

.btn-icon:hover {
    transform: scale(1.2);
}

/* ========================================================================
   Alerts
   ======================================================================== */

.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.alert h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.alert ul {
    margin-left: 1.5rem;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* ========================================================================
   Statistics
   ======================================================================== */

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1.5rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #0066cc;
}

.stat-label {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

/* ========================================================================
   Search Section
   ======================================================================== */

.search-section {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.search-form .form-row {
    margin-bottom: 0;
}

/* ========================================================================
   Table
   ======================================================================== */

.results-section {
    margin-top: 2rem;
}

.results-count {
    margin-bottom: 1rem;
    color: #666;
}

.cards-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.cards-table th,
.cards-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.cards-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c2c2c;
}

.cards-table tr:hover {
    background: #f8f9fa;
}

.cards-table tr.archived {
    opacity: 0.6;
}

.slug-cell {
    font-family: "Monaco", "Courier New", monospace;
}

.actions-cell {
    white-space: nowrap;
}

.actions-cell form {
    display: inline;
}

/* ========================================================================
   Badges
   ======================================================================== */

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
}

.badge-active {
    background: #d4edda;
    color: #155724;
}

.badge-archived {
    background: #f8d7da;
    color: #721c24;
}

/* ========================================================================
   Pagination
   ======================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.page-info {
    font-weight: 500;
    color: #666;
}

/* ========================================================================
   Success Page (After Card Creation)
   ======================================================================== */

.success-page {
    margin-top: 1rem;
}

.card-created {
    background: #d4edda;
    border: 2px solid #c3e6cb;
    border-radius: 6px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.card-created h2 {
    color: #155724;
    border: none;
    margin-top: 0;
}

.card-info {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    margin: 1.5rem 0;
}

.qr-display {
    background: white;
    padding: 2rem;
    border-radius: 6px;
    margin: 2rem 0;
    text-align: center;
}

.qr-code {
    margin: 2rem auto;
    display: inline-block;
    padding: 1rem;
    background: white;
    border: 2px solid #ddd;
    border-radius: 6px;
}

.qr-code svg {
    display: block;
    max-width: 300px;
    height: auto;
}

.qr-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.marking-example {
    margin: 1.5rem 0;
}

.marking-box {
    background: white;
    border: 3px solid #333;
    padding: 1.5rem;
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.marking-box p {
    margin: 0.5rem 0;
}

.marking-box .qr-small svg {
    max-width: 150px;
    height: auto;
    margin: 1rem auto;
}

.marking-box .url {
    font-size: 0.875rem;
    font-family: monospace;
    word-break: break-all;
}

.preview-section {
    margin-top: 2rem;
}

.card-preview {
    width: 100%;
    height: 600px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

/* ========================================================================
   Error Page
   ======================================================================== */

.error-page {
    text-align: center;
    padding: 3rem 1rem;
}

.error-page h1 {
    color: #721c24;
}

/* ========================================================================
   Footer
   ======================================================================== */

.site-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e0e0e0;
    text-align: center;
    color: #666;
    font-size: 0.875rem;
}

/* ========================================================================
   Responsive Utilities
   ======================================================================== */

@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
    }

    .admin-header,
    .admin-nav,
    .form-actions,
    .btn,
    .actions-cell {
        display: none;
    }
}
