@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette */
    --primary: #1E3A8A; /* Deep Blue from logo */
    --primary-hover: #1E40AF;
    --accent: #FBBF24; /* Yellow/Gold from logo */
    --accent-hover: #F59E0B;
    
    --bg-body: #F8FAFC;
    --bg-card: #FFFFFF;
    
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border-light: #E2E8F0;
    
    /* Layout & Utilities */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background-color: var(--bg-body); color: var(--text-main); line-height: 1.6; -webkit-font-smoothing: antialiased; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }

/* --- HEADER & NAVIGATION --- */
.main-header { background-color: var(--bg-card); padding: 0.4rem 0; box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--border-light); }
@media (max-width: 768px) { .main-header { padding: 0.2rem 0; } }
.header-container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.logo-link { display: inline-flex; align-items: center; text-decoration: none; }
.main-logo-img { height: 80px; width: auto; object-fit: contain; }
@media (max-width: 768px) { .main-logo-img { height: 40px; } }
.main-nav { display: flex; gap: 1.5rem; align-items: center; font-weight: 600; }
.main-nav a { color: var(--text-main); transition: color 0.2s ease; }
.main-nav a:hover { color: var(--primary); }
.nav-admin { background: #F1F5F9; padding: 0.4rem 1rem; border-radius: 20px; font-size: 0.9rem; }

/* --- BUTTONS --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1.5rem; font-weight: 600; border-radius: var(--radius-md); cursor: pointer; transition: var(--transition); border: 2px solid transparent; text-align: center; }
.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); color: white; }
.btn-accent { background-color: var(--accent); color: #78350F; }
.btn-accent:hover { background-color: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); color: #78350F; }
.btn-outline { background-color: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background-color: var(--primary); color: white; }
.btn-block { width: 100%; }

/* --- HERO SECTION --- */
.hero { background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%); color: white; padding: 5rem 0; text-align: center; border-radius: 0 0 2rem 2rem; margin-bottom: -3rem; padding-bottom: 7rem; }
.hero h2 { font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: -0.02em; }
.hero p { font-size: 1.125rem; color: #BFDBFE; max-width: 600px; margin: 0 auto 2.5rem; }

/* Filter Form */
.filter-wrapper { background: var(--bg-card); padding: 1.5rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; max-width: 800px; margin: 0 auto; position: relative; z-index: 10; }
.filter-form { display: flex; width: 100%; gap: 1rem; }
.filter-form .form-group { flex: 1; margin: 0; }
.filter-form .form-group label { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.25rem; }

/* --- FORM ELEMENTS --- */
.form-group { margin-bottom: 1.5rem; }
label { display: block; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-main); font-size: 0.95rem; }
input[type="text"], input[type="password"], select, textarea { width: 100%; padding: 0.875rem 1rem; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: #F8FAFC; color: var(--text-main); font-family: inherit; font-size: 1rem; transition: var(--transition); appearance: none; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); background: var(--bg-card); box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1); }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B'%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 1rem center; background-size: 1rem; padding-right: 2.5rem; }

/* --- DIRECTORY GRID --- */
.directory-section { padding-top: 5rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; }
.card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 1.75rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); transition: var(--transition); display: flex; flex-direction: column; height: 100%; }
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.75rem; line-height: 1.3; }
.card h3 a { color: var(--text-main); }
.card h3 a:hover { color: var(--primary); }
.card .meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.card .description { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; flex-grow: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 0.25rem 0.75rem; border-radius: 99px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-category { background: #E0E7FF; color: #3730A3; }
.badge-province { background: #FEF3C7; color: #92400E; }

/* --- DETAIL PAGE (Single Column) --- */
.back-link { font-weight: 600; display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text-muted); }
.back-link:hover { color: var(--primary); }

.single-company-wrapper { background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); max-width: 800px; margin: 0 auto; overflow: hidden; padding: 3rem; border: 1px solid var(--border-light); }
@media (max-width: 768px) { .single-company-wrapper { padding: 1.5rem; } }

.single-company-header { text-align: center; margin-bottom: 2rem; border-bottom: 2px solid var(--border-light); padding-bottom: 1.5rem; }
.single-company-header h1 { font-size: 2.25rem; font-weight: 800; color: var(--primary); margin-bottom: 1rem; }
.company-stats { display: flex; justify-content: center; align-items: center; gap: 1rem; flex-wrap: wrap; color: var(--text-muted); font-size: 0.9rem; }

.single-company-logo { text-align: center; margin-bottom: 2.5rem; }
.single-company-logo img { max-width: 100%; height: auto; max-height: 400px; object-fit: contain; border-radius: var(--radius-md); }

.single-company-contact-list { max-width: 500px; margin: 0 auto; }
.contact-line { display: flex; align-items: center; margin-bottom: 1rem; font-size: 1.1rem; }
.contact-line-icon { width: 40px; height: 40px; background: #F8FAFC; color: var(--primary); display: flex; align-items: center; justify-content: center; border-radius: 50%; margin-right: 1rem; font-size: 1.2rem; flex-shrink: 0; border: 1px solid var(--border-light); }
.contact-line a { color: var(--text-main); font-weight: 500; }
.contact-line a:hover { color: var(--primary); text-decoration: underline; }

.social-share { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border-light); text-align: center; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.5rem; }
.share-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); margin-right: 1rem; }
.share-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 1rem; font-size: 0.8rem; font-weight: 700; border-radius: 4px; color: white !important; }
.share-twitter { background-color: #1DA1F2; }
.share-facebook { background-color: #4267B2; }
.share-whatsapp { background-color: #25D366; }
.share-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* --- ADMIN PANEL --- */
.admin-layout { display: flex; min-height: 100vh; background: var(--bg-body); }
.admin-sidebar { width: 250px; background: #0F172A; color: white; padding: 2rem 0; flex-shrink: 0; }
.admin-sidebar .logo { color: white; padding: 0 1.5rem; margin-bottom: 2rem; font-size: 1.25rem; }
.admin-menu { list-style: none; }
.admin-menu a { display: block; padding: 1rem 1.5rem; color: #94A3B8; font-weight: 500; border-left: 3px solid transparent; }
.admin-menu a:hover, .admin-menu a.active { color: white; background: rgba(255,255,255,0.05); border-left-color: var(--accent); }
.admin-content { flex-grow: 1; padding: 3rem; overflow-y: auto; }

.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.5rem; }
.dashboard-header h1 { font-size: 1.875rem; font-weight: 700; color: var(--text-main); }

.stat-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 1.5rem; border: 1px solid var(--border-light); }
.stat-icon { width: 60px; height: 60px; border-radius: 1rem; background: #EFF6FF; color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: bold; }
.stat-info h4 { color: var(--text-muted); font-size: 0.875rem; font-weight: 600; text-transform: uppercase; margin-bottom: 0.25rem; }
.stat-info p { font-size: 2rem; font-weight: 800; color: var(--text-main); line-height: 1; }

/* Admin Tables */
.table-container { background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; border: 1px solid var(--border-light); margin-top: 1.5rem; }
table { width: 100%; border-collapse: collapse; }
th { background: #F8FAFC; text-align: left; padding: 1rem 1.5rem; font-size: 0.875rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border-light); }
td { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-light); color: var(--text-main); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #F1F5F9; }

/* Admin Forms */
.admin-form-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 2.5rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); max-width: 900px; margin: 0 auto; }
.form-section-title { font-size: 1.25rem; font-weight: 700; color: var(--text-main); margin-bottom: 1.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-light); margin-top: 2rem; }
.form-section-title:first-child { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
/* --- ADMIN PANEL & FORMS --- */
.admin-login-body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background-color: var(--bg-body); }
.login-container { background: var(--bg-card); padding: 2.5rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); width: 100%; max-width: 400px; border: 1px solid var(--border-light); }
.login-container h2 { text-align: center; color: var(--primary); margin-bottom: 2rem; font-weight: 800; }

.form-group { margin-bottom: 1.5rem; }
label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--text-main); }
input[type="text"], input[type="password"], input[type="email"], input[type="url"], input[type="tel"], textarea, select { width: 100%; padding: 0.8rem; border: 1px solid var(--border-light); border-radius: var(--radius-md); font-size: 1rem; transition: border-color 0.2s; background: white; color: var(--text-main); }
input:focus, textarea:focus, select:focus { border-color: var(--primary); outline: none; }

.admin-header { background: var(--primary); color: white; padding: 1rem 0; box-shadow: var(--shadow-sm); }
.admin-header h1 { margin: 0; font-size: 1.5rem; font-weight: 700; color: white; }
.admin-nav { display: flex; justify-content: space-between; align-items: center; }
.admin-nav ul { list-style: none; display: flex; gap: 1.5rem; align-items: center; margin: 0; padding: 0; }
.admin-nav a { color: white; text-decoration: none; font-weight: 500; opacity: 0.9; transition: opacity 0.2s; }
.admin-nav a:hover { opacity: 1; }

.admin-main { margin-top: 2rem; margin-bottom: 4rem; }
.admin-main h2 { color: var(--text-main); margin-bottom: 1.5rem; font-weight: 800; border-bottom: 2px solid var(--border-light); padding-bottom: 0.5rem; }

.dashboard-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.dashboard-grid .card { background: var(--bg-card); padding: 2rem; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); }
.stat-number { font-size: 3rem; font-weight: 900; color: var(--primary); margin: 1rem 0; }
.action-list { list-style: none; padding: 0; margin: 1rem 0 0 0; }
.action-list li { margin-bottom: 0.8rem; }
.action-list a { display: block; padding: 0.8rem 1rem; background: #F8FAFC; border-radius: var(--radius-sm); color: var(--primary); font-weight: 600; text-decoration: none; transition: background 0.2s; border: 1px solid var(--border-light); }
.action-list a:hover { background: #F1F5F9; }

.table-responsive { overflow-x: auto; margin-top: 1.5rem; background: var(--bg-card); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.admin-table th, .admin-table td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border-light); }
.admin-table th { background: #F8FAFC; font-weight: 600; color: var(--text-main); }
.admin-table tbody tr:hover { background: #F8FAFC; }
.actions-cell { display: flex; gap: 0.5rem; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn-danger { background: #ef4444; color: white; border-color: #ef4444; }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }
.btn-block { width: 100%; display: block; }

.alert { padding: 1rem; border-radius: var(--radius-md); margin-bottom: 1.5rem; font-weight: 500; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #f87171; }

/* Mobile Hamburger Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1000;
}
.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary);
    margin: 5px 0;
    transition: 0.3s;
}
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
        border-top: 1px solid var(--border-light);
        z-index: 999;
    }
    .main-nav.active {
        display: flex;
    }
    .main-nav a {
        padding: 1rem;
        border-bottom: 1px solid var(--border-light);
    }
    .main-nav a:last-child {
        border-bottom: none;
    }
}

/* Mobile Filters */
@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    .search-input, .search-select, .search-btn {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
    .search-btn {
        border-bottom: none;
    }
}

.main-footer { background-color: var(--primary); color: white; padding: 2rem 0; text-align: center; margin-top: auto; }

@media (max-width: 768px) {
  .filter-form { flex-direction: column !important; }
}
