/* static/css/taxstamps.css */
/* Tax Stamp Database - Project-wide CSS */

/* ============================================================================
   COUNTRY PAGES STYLING
   ============================================================================ */

/* Country Header Section */
.country-header {
    
    padding: 1rem 0;
    margin-bottom: 1rem;
}

/* Flag Styling */
.country-flag {
    width: 80px;
    height: auto;
    max-height: 80px;
    object-fit: contain;
}

.country-flag-small {
    width: 40px;
    height: auto;
    border: 1px solid #fff;
    border-radius: 3px;
    max-height: 30px;
    object-fit: contain;
}

/* Flag Fallbacks */
.flag-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border: 2px solid #fff;
    border-radius: 4px;
    color: white;
    font-weight: bold;
}

.country-flag-fallback {
    width: 80px;
    height: 60px;
}

.country-flag-small-fallback {
    width: 40px;
    height: 30px;
    font-size: 0.8rem;
}

.flag-placeholder {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ============================================================================
   LAYOUT COMPONENTS
   ============================================================================ */

/* Info Sections */
.info-section {
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0 4px 4px 0;
}

.section-title {
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* ============================================================================
   PROGRAM AND DATA CARDS
   ============================================================================ */

/* Program Cards */
.program-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.program-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.program-header {
    background: #e9ecef;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.program-content {
    padding: 1rem;
}

/* Authority Cards */
.authority-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: transform 0.2s ease;
}

.authority-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Specification and Tracking Cards */
.spec-card, .tracking-card {
    position: relative;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding-top:2rem;
    padding-bottom:1rem;
    padding-left:1rem;
    padding-right:1rem;
    background: white;
    margin-bottom: 1rem;
    line-height: 1.5rem;
}

.spec-grid {
    
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.spec-label {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 3px;
}
.spec-period-card {
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 1rem;
    background: #f8f9fa;
}

.spec-period-card.border-success {
    border-color: #198754 !important;
    border-width: 2px;
}
/* ============================================================================
   TABLES AND DATA DISPLAY
   ============================================================================ */

/* Consumption Tables */
.consumption-table {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.consumption-table .table {
    margin-bottom: 0;
}

.consumption-table .table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

/* ============================================================================
   COLLAPSIBLE SECTIONS
   ============================================================================ */

.collapsible-section {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.collapsible-header {
    background: #f8f9fa;
    padding: 1rem;
    cursor: pointer;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
    user-select: none;
}

.collapsible-header:hover {
    background: #e9ecef;
}

.collapsible-header::after {
    content: "▼";
    float: right;
    transition: transform 0.2s ease;
    color: blue;
    margin-top: -20px;
}

.collapsible-header.active::after {
    transform: rotate(-180deg);
}

.collapsible-content {
    padding: 1rem;
    display: none;
}

.collapsible-content.active {
    display: block;
    animation: slideDown 0.3s ease;
}

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

/* ============================================================================
   BADGES AND STATUS INDICATORS
   ============================================================================ */

/* Level Badges */
.badge-level {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-federal { background: #d4edda; color: #155724; }
.badge-state { background: #d1ecf1; color: #0c5460; }
.badge-local { background: #f8d7da; color: #721c24; }

/* Status Badges (extending Bootstrap) */
.badge.bg-active { background-color: #28a745 !important; }
.badge.bg-planned { background-color: #007bff !important; }
.badge.bg-suspended { background-color: #ffc107 !important; color: #212529 !important; }
.badge.bg-discontinued { background-color: #dc3545 !important; }

/* ============================================================================
   CONTRACTOR AND TEAM DISPLAY
   ============================================================================ */

.contractor-list {
    margin-top: 0.5rem;
}

.contractor-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
    display: inline-block;
    border: 1px solid #bbdefb;
}

.contractor-badge.main-contractor {
    background: #c8e6c9;
    color: #2e7d32;
    border-color: #a5d6a7;
    font-weight: 600;
}

/* ============================================================================
   COUNTRY LIST GRID
   ============================================================================ */

.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.country-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    background: white;
    text-decoration: none;
}

.country-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-decoration: none;
}

.country-card-header {
    padding: 1rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    background: #f8f9fa;
}

.country-card-body {
    padding: 1rem;
}

.country-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* ============================================================================
   AUTHORITY LIST STYLING
   ============================================================================ */

.authority-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.authority-list-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    background: white;
    text-decoration: none;
    color: inherit;
    display: block;
}

.authority-list-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
}

.authority-card-header {
    padding: 1rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    background: #f8f9fa;
}

.authority-card-header .authority-info {
    flex: 1;
}

.authority-card-header h5 {
    color: #212529;
}

.authority-card-body {
    padding: 1rem;
}

/* ============================================================================
   SEARCH AND NAVIGATION
   ============================================================================ */

.search-box {
    max-width: 400px;
    margin: 2rem auto;
}

/* Navigation improvements */
.breadcrumb {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 0.75rem 1rem;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

/* Text utilities */
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

/* Spacing utilities */
.mb-half { margin-bottom: 0.5rem; }
.mt-half { margin-top: 0.5rem; }

/* Border utilities */
.border-left-primary { border-left: 4px solid #007bff; }
.border-left-success { border-left: 4px solid #28a745; }
.border-left-warning { border-left: 4px solid #ffc107; }
.border-left-danger { border-left: 4px solid #dc3545; }

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

/* Mobile adjustments */
@media (max-width: 768px) {
    .country-header {
        padding: 1rem 0;
    }
    
    .country-flag {
        width: 60px;
        
    }
    
    .spec-grid {
        grid-template-columns: 1fr;
    }
    
    .country-grid {
        grid-template-columns: 1fr;
    }
    
    .program-header .row {
        flex-direction: column;
    }
    
    .program-header .col-auto {
        margin-top: 0.5rem;
    }
}

/* Print styles */
@media print {
    .country-header {
        background: #f8f9fa !important;
        color: #333 !important;
        -webkit-print-color-adjust: exact;
    }
    
    .collapsible-content {
        display: block !important;
    }
    
    .btn, .collapsible-header::after {
        display: none !important;
    }
}

/* ============================================================================
   DARK MODE SUPPORT (Optional)
   ============================================================================ 

@media (prefers-color-scheme: dark) {
    .program-card, .authority-card, .spec-card, .tracking-card {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .info-section {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .section-title {
        color: #e2e8f0;
        border-bottom-color: #4a5568;
    }
}
*/

/* ============================================================================
   DASHBOARD CARDS
   ============================================================================ */

.dashboard-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}