/* static/css/taxstamps.css */
/* Tax Stamp Database - Project-wide CSS */
:root {
    /* Tax stamp color palette - derived from DV-Taxstamps logo */
    --taxstamp-primary: #98001d;   /* Primary crimson from logo text */
    --taxstamp-accent: #de4561;    /* Bright red accent from logo */
    --taxstamp-light: #c4788a;     /* Muted rose, lighter shade of primary */
    --taxstamp-dark: #63003b;      /* Dark grey from logo */
    --taxstamp-bg: #f9f2f3;        /* Light warm background tint */
}

/* ============================================================================
   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;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    object-fit: cover;
}

.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;
}

/* Info Hint Badge - Clickable help/info indicator */
.info-hint-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 0.75rem;
    padding: 0.25rem 0.6rem;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 500;
    color: #1565c0;
    cursor: pointer;
    transition: all 0.3s ease;
    vertical-align: middle;
    animation: gentle-pulse 2s ease-in-out infinite;
}

.info-hint-badge:hover {
    background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
    border-color: #64b5f6;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.3);
    animation: none;
}

.info-hint-badge i {
    font-size: 0.8rem;
    margin-right: 0.35rem;
}

.info-hint-badge .info-hint-text {
    white-space: nowrap;
}

@keyframes gentle-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(21, 101, 192, 0.2);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(21, 101, 192, 0.1);
    }
}

/* ============================================================================
   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; }

/* ============================================================================
   COUNTRY PROGRAM STATUS BADGES
   ============================================================================ */

.country-program-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.program-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.program-status-badge .program-status-label {
    white-space: nowrap;
}

.program-status-badge .program-status-trace {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.15);
}

.program-status-badge .program-status-trace i {
    margin-right: 0.25rem;
    font-size: 0.65rem;
}

/* Tax Stamp Programme - Green */
.program-status-success {
    background-color: #28a745;
    color: #fff;
}

.program-status-success .program-status-trace {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Non-Tax Programme - Yellow/Warning */
.program-status-warning {
    background-color: #ffc107;
    color: #212529;
}

.program-status-warning .program-status-trace {
    background: rgba(0, 0, 0, 0.12);
    color: #212529;
}

/* No Programme - Grey */
.program-status-secondary {
    background-color: #6c757d;
    color: #fff;
}

.program-status-secondary .program-status-trace {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* ============================================================================
   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;
    }

    .country-program-badges {
        margin-top: 0.5rem;
    }

    .program-status-badge {
        font-size: 0.8rem;
        padding: 0.25rem 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);
}

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

.bg-taxstamp {
    background-color: var(--taxstamp-primary) !important;
}

.bg-taxstamp-accent {
    background-color: var(--taxstamp-accent) !important;
}

.bg-taxstamp-light {
    background-color: var(--taxstamp-light) !important;
}
.bg-taxstamp-dark {
    background-color: var(--taxstamp-dark) !important;
}

.text-taxstamp {
    color: var(--taxstamp-primary) !important;
}

.text-taxstamp-accent {
    color: var(--taxstamp-accent) !important;
}

.btn-taxstamp {
    background-color: var(--taxstamp-primary);
    border-color: var(--taxstamp-primary);
    color: white;
}

.btn-taxstamp:hover {
    background-color: var(--taxstamp-dark);
    border-color: var(--taxstamp-dark);
    color: white;
}

.btn-outline-taxstamp {
    color: var(--taxstamp-primary);
    border-color: var(--taxstamp-primary);
}

.btn-outline-taxstamp:hover {
    background-color: var(--taxstamp-primary);
    border-color: var(--taxstamp-primary);
    color: white;
}

.card-header-taxstamp {
    background-color: var(--taxstamp-primary);
    color: white;
}

.badge-taxstamp {
    background-color: var(--taxstamp-primary);
    color: white;
}

.badge-taxstamp-accent {
    background-color: var(--taxstamp-accent);
    color: white;
}

/* ============================================================================
   HELP CONTENT SYSTEM
   ============================================================================ */

.help-popover-btn, .help-guide-btn {
    border: none; background: none; line-height: 1;
    vertical-align: middle; cursor: pointer;
    font-size: 0.85rem; opacity: 0.6; transition: opacity 0.2s;
   
}
.help-popover-btn:hover, .help-popover-btn:focus,
.help-guide-btn:hover, .help-guide-btn:focus {
    opacity: 1; text-decoration: none;
}
.help-guide-content img { max-width: 100%; height: auto; }
.help-guide-content iframe { max-width: 100%; }

#helpGuideModal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

button i.fas.fa-info-circle.text-muted:before{
    color: var(--taxstamp-primary);
}
.custom-popover {
   --bs-popover-border-color: var(--taxstamp-primary);
  --bs-popover-header-bg: var(--taxstamp-primary);
  --bs-popover-header-color: var(--bs-white);
  --bs-popover-body-padding-x: 1rem;
  --bs-popover-body-padding-y: .5rem;
}
.modal-header {
    background-color: var(--taxstamp-primary);
    color: white;
    
}

.modal-content {
    border-radius: 8px;
    border: 1px solid var(--taxstamp-primary);
}
