/* ============================================
   OYSPHCB Portal - Main Stylesheet
   Primary: #04753A | Secondary: #E5C234
   ============================================ */

:root {
    --primary: #04753A;
    --primary-dark: #035a2d;
    --primary-light: #e8f5ee;
    --secondary: #E5C234;
    --secondary-dark: #c9a82a;
    --secondary-light: #fdf8e1;
    --dark: #1a1a2e;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-500: #6c757d;
    --gray-700: #495057;
    --white: #ffffff;
    --danger: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
    --info: #17a2b8;
    --shadow: 0 2px 15px rgba(0,0,0,0.08);
    --shadow-lg: 0 5px 30px rgba(0,0,0,0.12);
    --radius: 10px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--dark);
    background: var(--gray-100);
    line-height: 1.6;
}

a { text-decoration: none; color: var(--primary); transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; }

/* ---- Utility Classes ---- */
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.bg-secondary { background-color: var(--secondary) !important; }
.bg-primary-light { background-color: var(--primary-light) !important; }

/* ---- Buttons ---- */
.btn-primary-custom {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-primary-custom:hover {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(4,117,58,0.3);
}

.btn-secondary-custom {
    background: var(--secondary);
    color: var(--dark);
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-secondary-custom:hover {
    background: var(--secondary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(229,194,52,0.3);
}

.btn-outline-custom {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 8px 22px;
    border-radius: var(--radius);
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}
.btn-outline-custom:hover {
    background: var(--primary);
    color: var(--white);
}

/* ---- Cards ---- */
.card-custom {
    background: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}
.card-custom:hover {
    box-shadow: var(--shadow-lg);
}

/* ---- Navbar ---- */
.navbar-custom {
    background: var(--white);
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
    padding: 12px 0;
}
.navbar-custom .navbar-brand {
    font-weight: 800;
    color: var(--primary);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.navbar-custom .navbar-brand img {
    height: 42px;
}
.navbar-custom .nav-link {
    color: var(--gray-700);
    font-weight: 500;
    padding: 8px 16px !important;
    border-radius: 8px;
    transition: var(--transition);
}
.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

/* ---- Hero Section ---- */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(229,194,52,0.1);
}
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}
.hero-section h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}
.hero-section p {
    font-size: 1.15rem;
    opacity: 0.9;
    margin-bottom: 30px;
}
.hero-badge {
    display: inline-block;
    background: var(--secondary);
    color: var(--dark);
    padding: 6px 16px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

/* ---- Stats Section ---- */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-bottom: 4px solid transparent;
}
.stat-card:hover {
    transform: translateY(-5px);
    border-bottom-color: var(--primary);
}
.stat-card .icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.5rem;
}
.stat-card h3 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}
.stat-card p {
    color: var(--gray-500);
    font-weight: 500;
    margin: 0;
}

/* ---- Sidebar (Admin/Staff) ---- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: var(--white);
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
}
.sidebar .brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar .brand img {
    height: 40px;
}
.sidebar .brand h5 {
    font-weight: 700;
    margin: 0;
    font-size: 1rem;
}
.sidebar .brand small {
    opacity: 0.7;
    font-size: 0.75rem;
}
.sidebar .nav-menu {
    padding: 15px 0;
    list-style: none;
}
.sidebar .nav-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: rgba(255,255,255,0.75);
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.sidebar .nav-menu li a:hover,
.sidebar .nav-menu li a.active {
    color: var(--white);
    background: rgba(255,255,255,0.1);
    border-left-color: var(--secondary);
}
.sidebar .nav-menu li a i {
    width: 20px;
    text-align: center;
}
.sidebar .nav-section {
    padding: 10px 24px 5px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    font-weight: 700;
}

/* ---- Main Content (Dashboard) ---- */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    background: var(--gray-100);
}
.topbar {
    background: var(--white);
    padding: 16px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
}
.topbar h4 {
    font-weight: 700;
    margin: 0;
    color: var(--dark);
}
.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar .user-info .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 700;
}
.content-area {
    padding: 30px;
}

/* ---- Dashboard Cards ---- */
.dash-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}
.dash-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.dash-card .icon-box {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.dash-card .info h6 {
    color: var(--gray-500);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 4px;
}
.dash-card .info h3 {
    font-weight: 800;
    margin: 0;
}

/* ---- Tables ---- */
.table-custom {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.table-custom .table {
    margin: 0;
}
.table-custom .table thead th {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    border: none;
    padding: 14px 16px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table-custom .table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-color: var(--gray-200);
}
.table-custom .table tbody tr:hover {
    background: var(--primary-light);
}

/* ---- Status Badges ---- */
.badge-status {
    padding: 5px 14px;
    border-radius: 30px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge-pending { background: #fff3cd; color: #856404; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.badge-suspended { background: #e2e3e5; color: #383d41; }

/* ---- Forms ---- */
.form-custom .form-label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.9rem;
    margin-bottom: 6px;
}
.form-custom .form-control,
.form-custom .form-select {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 10px 14px;
    transition: var(--transition);
    font-size: 0.95rem;
}
.form-custom .form-control:focus,
.form-custom .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(4,117,58,0.15);
}

/* ---- Auth Pages ---- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #023020 100%);
    padding: 20px;
}
.auth-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    padding: 40px;
}
.auth-card .logo {
    text-align: center;
    margin-bottom: 30px;
}
.auth-card .logo img {
    height: 70px;
    margin-bottom: 12px;
}
.auth-card .logo h4 {
    color: var(--primary);
    font-weight: 800;
}
.auth-card .logo p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* ---- Profile Page (Public) ---- */
.profile-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 50px 0 80px;
    color: var(--white);
    text-align: center;
    position: relative;
}
.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid var(--white);
    object-fit: cover;
    margin: -75px auto 0;
    display: block;
    position: relative;
    z-index: 10;
    background: var(--white);
}
.profile-card {
    max-width: 800px;
    margin: -40px auto 40px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 90px 40px 40px;
    text-align: center;
    position: relative;
}
.profile-card h2 {
    font-weight: 800;
    color: var(--dark);
}
.profile-card .staff-id-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    margin: 10px 0;
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    text-align: left;
    margin: 30px 0;
}
.detail-item {
    padding: 15px;
    background: var(--gray-100);
    border-radius: var(--radius);
}
.detail-item label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}
.detail-item span {
    font-weight: 600;
    color: var(--dark);
}

/* ---- Reviews Section ---- */
.review-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 15px;
}
.review-card .reviewer {
    font-weight: 700;
    margin-bottom: 4px;
}
.review-card .date {
    font-size: 0.82rem;
    color: var(--gray-500);
}
.review-card .comment {
    margin-top: 10px;
    color: var(--gray-700);
}

/* ---- ID Card ---- */
.id-card {
    width: 340px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin: 0 auto;
    border: 2px solid var(--primary);
}
.id-card-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: 16px 20px;
    text-align: center;
}
.id-card-header h6 {
    font-weight: 800;
    margin: 0;
    font-size: 0.85rem;
}
.id-card-header small {
    opacity: 0.8;
    font-size: 0.7rem;
}
.id-card-body {
    padding: 20px;
    text-align: center;
}
.id-card-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    object-fit: cover;
    margin: 0 auto 12px;
}
.id-card-body h5 {
    font-weight: 800;
    margin-bottom: 2px;
}
.id-card-body .dept {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-bottom: 10px;
}
.id-card-details {
    text-align: left;
    font-size: 0.82rem;
    margin-top: 12px;
}
.id-card-details .row-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px dashed var(--gray-200);
}
.id-card-details .row-item label {
    color: var(--gray-500);
    font-weight: 500;
}
.id-card-details .row-item span {
    font-weight: 700;
}
.id-card-footer {
    background: var(--secondary-light);
    padding: 15px 20px;
    text-align: center;
    border-top: 2px solid var(--secondary);
}
.id-card-footer .barcode-img {
    max-width: 200px;
    margin: 0 auto;
}

/* ---- Notifications ---- */
.notification-dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    display: inline-block;
    margin-left: 5px;
}

/* ---- Rating Stars ---- */
.star-rating {
    display: flex;
    gap: 4px;
    font-size: 1.5rem;
    cursor: pointer;
}
.star-rating .star { color: var(--gray-300); transition: var(--transition); }
.star-rating .star.active,
.star-rating .star:hover,
.star-rating .star:hover ~ .star { color: var(--secondary); }
.text-warning { color: var(--secondary) !important; }

/* ---- Footer ---- */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.7);
    padding: 40px 0 20px;
}
.footer h6 {
    color: var(--white);
    font-weight: 700;
    margin-bottom: 15px;
}
.footer a {
    color: rgba(255,255,255,0.6);
    display: block;
    padding: 4px 0;
    font-size: 0.9rem;
}
.footer a:hover { color: var(--secondary); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    margin-top: 30px;
    text-align: center;
    font-size: 0.85rem;
}

/* ---- Alerts ---- */
.alert-custom {
    border-radius: var(--radius);
    border: none;
    padding: 14px 20px;
    font-weight: 500;
}

/* ---- Loading Spinner ---- */
.spinner-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    display: none;
}
.spinner-overlay.active { display: flex; }

/* ---- Responsive ---- */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1050;
    }
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    .main-content {
        margin-left: 0;
    }
    .hero-section h1 {
        font-size: 2rem;
    }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .hero-section {
        padding: 50px 0;
    }
    .hero-section h1 {
        font-size: 1.8rem;
    }
    .content-area {
        padding: 15px;
    }
    .profile-card {
        padding: 80px 20px 30px;
        margin: -40px 15px 30px;
    }
    .auth-card {
        padding: 30px 20px;
    }
}

/* ---- Animations ---- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* ---- Print ID Card ---- */
@media print {
    body * { visibility: hidden; }
    #idCardPrintArea, #idCardPrintArea * { visibility: visible !important; }
    #idCardPrintArea { position: absolute; left: 0; top: 0; width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; padding: 20px; }
    #idCardPrintArea > div > p { display: none !important; }
    .id-card { break-inside: avoid; }
}
