/* =========================================
   1. GLOBAL RESET & TYPOGRAPHY
   ========================================= */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #005f73;
    transition: color 0.2s;
}

a:hover {
    color: #0a9396;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   2. TOP NAVIGATION
   ========================================= */
.top-nav {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.logo .highlight {
    color: #0a9396;
}

.nav-links a {
    margin-left: 20px;
    color: #555;
    font-weight: 500;
}

.btn-nav {
    background: #005f73;
    color: white !important;
    padding: 8px 15px;
    border-radius: 4px;
}

.btn-nav:hover {
    background: #003f4d;
}

/* =========================================
   3. HERO SECTION (Homepage)
   ========================================= */
.hero {
    background: linear-gradient(135deg, #005f73 0%, #0a9396 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    margin: 0 0 10px 0;
    font-size: 2.5rem;
}

.hero p {
    margin-bottom: 30px;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Search Box Styles */
.search-box {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.search-box input {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    border: none;
    border-radius: 4px 0 0 4px;
    outline: none;
}

.search-box button {
    padding: 15px 30px;
    background-color: #e9d8a6; /* Gold/Yellow */
    color: #005f73;
    font-weight: bold;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 16px;
}

.search-box button:hover {
    background-color: #ee9b00;
    color: white;
}

/* =========================================
   4. GRID & CARDS (Homepage Results)
   ========================================= */
.featured-section, .results-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

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

.card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    margin-top: 0;
    color: #005f73;
}

.featured-card {
    border-top: 4px solid #0a9396;
}

.badge-verified {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e9f5f5;
    color: #0a9396;
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 12px;
    font-weight: bold;
}

.btn-view {
    display: inline-block;
    margin-top: 15px;
    text-decoration: none;
    color: #005f73;
    font-weight: bold;
    border: 1px solid #005f73;
    padding: 8px 15px;
    border-radius: 4px;
}

.btn-view:hover {
    background-color: #005f73;
    color: white;
}

/* =========================================
   5. PROFILE PAGE (Details.php)
   ========================================= */
.breadcrumb {
    background: #eee;
    padding: 10px 0;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.profile-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 2fr 1fr; /* Main Content takes 2/3, Sidebar 1/3 */
    gap: 40px;
    margin-bottom: 60px;
}

.profile-header h1 {
    margin-bottom: 5px;
    font-size: 2.2rem;
    color: #222;
}

.location-sub {
    color: #666;
    margin-top: 0;
    font-size: 1.1rem;
}

.verified-badge-large {
    background-color: #e9f5f5;
    color: #0a9396;
    display: inline-block;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: bold;
    border: 1px solid #0a9396;
    margin-top: 15px;
}

/* Info Blocks (White boxes) */
.info-block {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}

.info-block h2 {
    margin-top: 0;
    border-bottom: 2px solid #f4f7f6;
    padding-bottom: 10px;
    font-size: 1.4rem;
}

/* License Table */
.license-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.license-table th {
    text-align: left;
    color: #777;
    font-size: 0.85rem;
    padding-bottom: 10px;
}

.license-table td {
    padding: 12px 0;
    border-top: 1px solid #eee;
    vertical-align: top;
}

.status-active {
    color: green;
    font-weight: bold;
    background: #e8f5e9;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.status-inactive {
    color: #d32f2f;
    font-weight: bold;
    background: #ffebee;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Membership Grid (Profile) */
.association-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.assoc-card {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #eee;
}

.assoc-icon {
    font-size: 1.5rem;
    color: #e9d8a6;
    margin-right: 15px;
}

/* Sidebar & Buttons */
.sidebar-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.contact-row {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.contact-row i {
    color: #005f73;
    margin-top: 4px;
}

.btn {
    display: block;
    width: 100%;
    padding: 12px;
    text-align: center;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 10px;
    font-weight: bold;
}

.btn-primary {
    background: #005f73;
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #003f4d;
}

.btn-outline {
    background: transparent;
    border: 2px solid #ccc;
    color: #555;
}

.btn-small-outline {
    display: inline-block;
    padding: 5px 10px;
    font-size: 0.8rem;
    border: 1px solid #005f73;
    color: #005f73;
    text-decoration: none;
    border-radius: 4px;
}

.btn-small-outline:hover {
    background-color: #005f73;
    color: white;
}

/* =========================================
   6. FOOTER
   ========================================= */
.site-footer {
    background: #222;
    color: #aaa;
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-col h3 {
    color: white;
    margin-top: 0;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col a {
    color: #aaa;
    text-decoration: none;
}

.footer-col a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #333;
    margin-top: 40px;
    padding-top: 20px;
    font-size: 0.9rem;
}

.print-only {
    display: none;
}

/* =========================================
   7. PRINT MODE (Hides Nav, Sidebar, Footer)
   ========================================= */
@media print {
    /* Hide navigation, buttons, and sidebar */
    .no-print, .btn, .sidebar, .breadcrumb, .top-nav, .site-footer {
        display: none !important;
    }

    /* Reset Layout for Paper */
    body {
        background: white;
        color: black;
        margin: 0;
        padding: 0;
    }

    .profile-container {
        display: block;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .main-content {
        width: 100%;
        box-shadow: none;
        border: none;
    }

    .info-block {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }

    /* Make Links Text-Only */
    a {
        text-decoration: none;
        color: black;
    }

    /* Show the Print Footer */
    .print-only {
        display: block !important;
        margin-top: 50px;
        text-align: center;
        border-top: 2px solid #333;
        padding-top: 20px;
    }

    /* Force background colors to print (for badges) */
    .status-active {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        border: 1px solid green;
    }

    .verified-badge-large {
        border: 2px solid #000;
        color: #000;
        background: none;
    }
}

/* =========================================
   8. MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .profile-container {
        grid-template-columns: 1fr;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box input {
        border-radius: 4px 4px 0 0;
    }

    .search-box button {
        border-radius: 0 0 4px 4px;
        width: 100%;
    }

    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .nav-links a {
        margin: 0;
    }
}
