/* Charity Record - Site-wide Custom Styles */

@tailwind base;
@tailwind components;
@tailwind utilities;

/* Tailwind Configuration (extends CDN defaults) */
:root {
    --color-primary: #1E88E5;      /* Medium blue */
    --color-secondary: #43A047;    /* Fresh green */
    --color-accent: #FF7043;       /* Soft coral (used for fills/backgrounds) */
    --color-accent-text: #E4572E;  /* Darker accent for text to meet contrast */
    --color-error: #E53935;        /* Red for errors */
}

/* Custom utility classes that might be needed across the app */

/* Alpine.js cloak to prevent flash of unstyled content */
[x-cloak] {
    display: none !important;
}

/* Focus ring consistency */
.focus-ring {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.5);
}

/* Reusable white card/section pattern used in forms */
.card-section {
    background-color: white;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
}

/* Accessibility: ensure accent text meets contrast on white */
.text-accent { color: var(--color-accent-text) !important; }
.border-accent { border-color: var(--color-accent-text) !important; }
.hover\:text-accent:hover { color: var(--color-accent-text) !important; }

/* List page common patterns */

/* Primary action button (Add charity, Add donation, etc.) */
.btn-primary-action {
    padding: 0.625rem 1.25rem;
    background-color: var(--color-primary);
    color: white;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
}

.btn-primary-action:hover {
    background-color: #1976D2;
}

.btn-primary-action:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.5);
}

/* Search input */
.search-input {
    width: 16rem;
    padding-left: 2rem;
    padding-right: 0.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.search-input:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.5);
    border-color: transparent;
}

@media (max-width: 640px) {
    .search-input {
        font-size: 0.8125rem;
        padding-top: 0.4375rem;
        padding-bottom: 0.4375rem;
    }
}

/* Entries per page dropdown */
.entries-per-page-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    background-color: white;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;
}

.entries-per-page-select:hover {
    background-color: #f9fafb;
}

.entries-per-page-select:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.5);
    border-color: transparent;
}

/* Pagination buttons */
.pagination-btn {
    padding: 0.25rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    color: #1E88E5;
    text-decoration: none;
}

.pagination-btn:hover {
    background-color: #eff6ff;
}

.pagination-btn-disabled {
    padding: 0.25rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Table styles */
.data-table {
    width: 100%;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    overflow: hidden;
}

.data-table thead {
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.data-table tbody tr {
    border-top: 1px solid #e5e7eb;
}

.data-table tbody tr:first-child {
    border-top: none;
}

.data-table tbody tr:hover {
    background-color: #f9fafb;
}

.data-table td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
}

/* Mobile table adjustments */
@media (max-width: 768px) {
    .data-table {
        font-size: 0.75rem;
    }

    .data-table th {
        padding: 0.5rem 0.75rem;
        font-size: 0.625rem;
    }

    .data-table td {
        padding: 0.75rem;
        font-size: 0.75rem;
    }

    /* Make table cells not wrap to keep table compact */
    .data-table td {
        white-space: nowrap;
    }
}

/* Primary cell content (bold org/charity name) */
.table-primary-text {
    font-weight: 500;
    color: #111827;
}

/* Secondary cell content (gray address or description) */
.table-secondary-text {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.125rem;
}

/* Blog prose styling - override Tailwind prose defaults */
.prose a {
    color: var(--color-primary) !important;
    text-decoration: underline;
}

.prose a:hover {
    color: #1976D2 !important;
}
