/* ====================================
   MANAY FAMILY PROFILING SYSTEM
   Government Standard Design System
   Yellow Theme - Professional Layout
   ==================================== */

:root {
    /* Primary Yellow Palette */
    --gov-yellow-primary: #EAB308;
    --gov-yellow-dark: #CA8A04;
    --gov-yellow-darker: #A16207;
    --gov-yellow-light: #FEF08A;
    --gov-yellow-lighter: #FEFCE8;

    /* Neutral Colors */
    --gov-gray-50: #F9FAFB;
    --gov-gray-100: #F3F4F6;
    --gov-gray-200: #E5E7EB;
    --gov-gray-300: #D1D5DB;
    --gov-gray-400: #9CA3AF;
    --gov-gray-500: #6B7280;
    --gov-gray-600: #4B5563;
    --gov-gray-700: #374151;
    --gov-gray-800: #1F2937;
    --gov-gray-900: #111827;

    /* Status Colors */
    --gov-success: #059669;
    --gov-warning: #D97706;
    --gov-error: #EF4444;
    --gov-info: #2563EB;

    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --spacing-unit: 8px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* ====================================
   GOVERNMENT HEADER STYLES
   ==================================== */

.gov-header {
    background: linear-gradient(135deg, var(--gov-yellow-primary) 0%, var(--gov-yellow-dark) 100%);
    color: white;
    box-shadow: var(--shadow-lg);
    border-bottom: 3px solid var(--gov-yellow-darker);
}

.gov-header-top {
    background: var(--gov-yellow-darker);
    padding: 8px 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.gov-seal {
    border: 3px solid white;
    border-radius: 50%;
    padding: 4px;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.gov-title {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.025em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ====================================
   SIDEBAR NAVIGATION
   ==================================== */

.gov-sidebar {
    background: white;
    border-right: 2px solid var(--gov-gray-200);
    box-shadow: var(--shadow-md);
}

.gov-nav-item {
    position: relative;
    transition: all 0.2s ease;
    border-radius: var(--radius-md);
    margin: 4px 8px;
}

.gov-nav-item:hover {
    background: var(--gov-yellow-lighter);
    color: var(--gov-yellow-dark);
}

.gov-nav-item.active {
    background: var(--gov-yellow-primary);
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.gov-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: white;
    border-radius: 0 4px 4px 0;
}

.gov-nav-section-title {
    color: var(--gov-gray-500);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px 8px;
    margin-top: 16px;
    border-top: 1px solid var(--gov-gray-200);
}

/* ====================================
   CARDS & PANELS
   ==================================== */

.gov-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gov-gray-200);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.gov-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gov-yellow-light);
}

.gov-card-header {
    border-bottom: 2px solid var(--gov-gray-100);
    padding: 20px 24px;
    background: var(--gov-gray-50);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.gov-card-accent {
    border-top: 4px solid var(--gov-yellow-primary);
}

.gov-stat-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gov-gray-200);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gov-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gov-yellow-primary), var(--gov-yellow-dark));
}

.gov-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ====================================
   BUTTONS
   ==================================== */

.gov-btn {
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-size: 14px;
    padding: 10px 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 2px solid transparent;
    cursor: pointer;
}

.gov-btn-primary {
    background: var(--gov-yellow-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.gov-btn-primary:hover {
    background: var(--gov-yellow-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

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

.gov-btn-secondary {
    background: white;
    color: var(--gov-yellow-primary);
    border-color: var(--gov-yellow-primary);
}

.gov-btn-secondary:hover {
    background: var(--gov-yellow-lighter);
    border-color: var(--gov-yellow-dark);
}

.gov-btn-outline {
    background: transparent;
    color: var(--gov-gray-700);
    border-color: var(--gov-gray-300);
}

.gov-btn-outline:hover {
    background: var(--gov-gray-50);
    border-color: var(--gov-yellow-primary);
    color: var(--gov-yellow-primary);
}

/* ====================================
   FORMS & INPUTS
   ==================================== */

.gov-input {
    border: 2px solid var(--gov-gray-300);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 14px;
    transition: all 0.2s ease;
    width: 100%;
}

.gov-input:focus {
    outline: none;
    border-color: var(--gov-yellow-primary);
    box-shadow: 0 0 0 3px var(--gov-yellow-light);
}

.gov-label {
    font-weight: 600;
    color: var(--gov-gray-700);
    font-size: 14px;
    margin-bottom: 6px;
    display: block;
}

.gov-label-required::after {
    content: '*';
    color: var(--gov-yellow-primary);
    margin-left: 4px;
}

/* ====================================
   TABLES
   ==================================== */

.gov-table {
    width: 100%;
    border-collapse: collapse;
}

.gov-table thead {
    background: var(--gov-gray-50);
    border-bottom: 2px solid var(--gov-yellow-primary);
}

.gov-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    color: var(--gov-gray-700);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gov-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gov-gray-200);
}

.gov-table tbody tr {
    transition: background 0.2s ease;
}

.gov-table tbody tr:hover {
    background: var(--gov-yellow-lighter);
}

/* ====================================
   BADGES & STATUS
   ==================================== */

.gov-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.gov-badge-yellow {
    background: var(--gov-yellow-lighter);
    color: var(--gov-yellow-dark);
    border: 1px solid var(--gov-yellow-light);
}

.gov-badge-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.gov-badge-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

/* ====================================
   FOOTER
   ==================================== */

.gov-footer {
    background: var(--gov-gray-800);
    color: var(--gov-gray-300);
    border-top: 4px solid var(--gov-yellow-primary);
    padding: 32px 0 24px;
    margin-top: 60px;
}

.gov-footer-link {
    color: var(--gov-gray-300);
    text-decoration: none;
    transition: color 0.2s ease;
}

.gov-footer-link:hover {
    color: white;
    text-decoration: underline;
}

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

.gov-text-yellow {
    color: var(--gov-yellow-primary);
}

.gov-bg-yellow {
    background: var(--gov-yellow-primary);
}

.gov-border-yellow {
    border-color: var(--gov-yellow-primary);
}

.gov-divider {
    border-top: 2px solid var(--gov-gray-200);
    margin: 24px 0;
}

.gov-section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gov-gray-900);
    margin-bottom: 8px;
    position: relative;
    padding-bottom: 12px;
}

.gov-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--gov-yellow-primary);
    border-radius: 2px;
}

/* ====================================
   ACCESSIBILITY
   ==================================== */

.gov-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--gov-yellow-primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    z-index: 1000;
}

.gov-skip-link:focus {
    top: 0;
}

*:focus-visible {
    outline: 3px solid var(--gov-yellow-primary);
    outline-offset: 2px;
}

/* ====================================
   RESPONSIVE UTILITIES
   ==================================== */

@media (max-width: 768px) {
    .gov-header-top {
        font-size: 11px;
    }

    .gov-stat-card {
        margin-bottom: 16px;
    }

    .gov-table {
        font-size: 13px;
    }

    .gov-table th,
    .gov-table td {
        padding: 10px 12px;
    }
}

/* ====================================
   PRINT STYLES
   ==================================== */

@media print {
    .gov-header,
    .gov-sidebar,
    .gov-footer,
    .gov-btn,
    .no-print {
        display: none !important;
    }

    .gov-card {
        box-shadow: none;
        border: 1px solid #000;
    }

    body {
        font-size: 12pt;
        color: #000;
    }
}

/* ====================================
   MOBILE RESPONSIVE STYLES
   ==================================== */

/* Mobile Hamburger Menu */
.mobile-menu-button {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    z-index: 60;
    background: var(--gov-yellow-primary);
    color: white;
    padding: 1rem;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.4);
    transition: all 0.3s ease;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-button:hover {
    background: var(--gov-yellow-dark);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(234, 179, 8, 0.5);
}

.mobile-menu-button:active {
    transform: scale(0.95);
}

/* Tablet Styles (768px and below) */
@media (max-width: 768px) {
    /* Show mobile menu button */
    .mobile-menu-button {
        display: block;
    }

    /* Header adjustments */
    .gov-header-top {
        font-size: 10px;
        padding: 6px 0;
    }

    .gov-header {
        padding: 0.5rem !important;
        margin-top: 0 !important;
    }

    .gov-seal {
        height: 40px !important;
        width: 40px !important;
    }

    .gov-title {
        font-size: 14px !important;
    }

    /* Hide sidebar by default on mobile */
    .gov-sidebar {
        position: fixed !important;
        left: -280px !important;
        top: 0 !important;
        transition: left 0.3s ease;
        z-index: 50 !important;
        width: 240px !important;
        height: 100vh !important;
        overflow-y: auto;
    }

    .gov-sidebar.mobile-open {
        left: 0 !important;
    }

    /* Mobile overlay when sidebar is open */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 49;
    }

    .mobile-overlay.show {
        display: block;
    }

    /* Main content takes full width */
    main {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 1rem !important;
    }

    /* Footer adjustments */
    .gov-footer {
        margin-left: 0 !important;
    }

    /* Stat cards stack vertically */
    .gov-stat-card {
        margin-bottom: 1rem;
    }

    /* Tables scroll horizontally */
    .gov-table-container,
    .overflow-x-auto {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .gov-table {
        min-width: 600px;
    }

    /* Cards adjust padding */
    .gov-card {
        padding: 1rem !important;
    }

    /* Forms stack vertically */
    .grid,
    .grid-cols-1,
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4,
    .md\\:grid-cols-2,
    .md\\:grid-cols-3,
    .md\\:grid-cols-4,
    .lg\\:grid-cols-2,
    .lg\\:grid-cols-3,
    .lg\\:grid-cols-4 {
        grid-template-columns: 1fr !important;
        display: grid !important;
    }

    /* Flex containers also stack */
    .flex.lg\\:flex-row,
    .flex.md\\:flex-row {
        flex-direction: column !important;
    }

    /* Buttons full width on mobile */
    .gov-btn {
        width: 100% !important;
        justify-content: center;
    }

    /* Modal adjustments */
    .fixed.inset-0 > div {
        max-width: 95% !important;
        margin: 1rem;
    }

    /* Hide certain text on very small screens */
    .hidden-mobile {
        display: none !important;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .gov-header-top {
        display: none;
    }

    .gov-title {
        font-size: 12px !important;
        line-height: 1.2;
    }

    .gov-seal {
        height: 32px !important;
        width: 32px !important;
    }

    /* Smaller button on small screens */
    .mobile-menu-button {
        width: 48px;
        height: 48px;
        bottom: 1.5rem;
        right: 1rem;
    }

    /* Even smaller padding */
    main {
        padding: 0.5rem !important;
    }

    .gov-card {
        padding: 0.75rem !important;
        margin-bottom: 0.75rem;
    }

    /* Stat cards more compact */
    .text-4xl {
        font-size: 2rem !important;
    }

    .text-3xl {
        font-size: 1.5rem !important;
    }

    .text-2xl {
        font-size: 1.25rem !important;
    }

    /* Buttons stack */
    .flex.space-x-3,
    .flex.gap-3 {
        flex-direction: column;
        gap: 0.5rem !important;
    }

    .flex.space-x-3 > *,
    .flex.gap-3 > * {
        margin: 0 !important;
        width: 100%;
    }

    /* Table text smaller */
    .gov-table {
        font-size: 12px;
    }

    .gov-th,
    .gov-td {
        padding: 0.5rem !important;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .gov-header {
        position: relative;
    }

    main {
        padding-top: 0 !important;
    }
}

/* Tablet Landscape (1024px and below) */
@media (max-width: 1024px) {
    .gov-sidebar {
        width: 200px;
    }

    main {
        margin-left: 200px;
    }

    .gov-footer {
        margin-left: 200px;
    }

    /* Adjust grid columns */
    .grid.lg\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .grid.lg\\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .grid.lg\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    .gov-btn,
    .gov-nav-item,
    button {
        min-height: 44px;
        min-width: 44px;
    }

    .gov-input,
    .gov-select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}
