:root {
    --bg-color: #f1f5f9;
    --card-bg: #ffffff;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #0ea5e9;
    --success: #10b981;
    --danger: #ef4444;
    --border-radius: 12px;
}

/* Global Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Compact Career Preferences */
.career-preferences-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    font-size: 9pt;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    min-height: 100vh;
}

/* Layout for Dashboard with Sidebar */
body.layout-has-sidebar {
    display: flex;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

/* Sidebar Style */
.navbar {
    display: none; /* Default hidden */
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    border-bottom: none;
    padding: 24px;
    box-sizing: border-box;
    /* display: flex; Moved to .layout-has-sidebar */
    flex-direction: column;
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

body.sidebar-collapsed .navbar {
    width: 80px;
    padding: 24px 12px;
    overflow: visible !important;
    z-index: 1001; /* Higher than top-header or other elements */
}

body.sidebar-collapsed .nav-content {
    overflow: visible !important;
}

body.layout-has-sidebar .navbar {
    display: flex;
}

.nav-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: flex-start;
    height: 100%;
}

.logo {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.3s;
}

.logo .logo-text {
    font-family: "Quicksand", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-weight: 500;
    color: #000000;
    -webkit-text-fill-color: initial;
    background: none;
    transition: opacity 0.3s, visibility 0.3s;
}

body.sidebar-collapsed .logo {
    justify-content: center;
}

body.sidebar-collapsed .logo .logo-text {
    opacity: 0;
    visibility: hidden;
    width: 0;
}

.nav-links {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px; /* Space for scrollbar */
}

body.sidebar-collapsed .nav-links {
    overflow: visible !important;
}

/* Custom Scrollbar for Nav Links */
.nav-links::-webkit-scrollbar {
    width: 4px;
}

.nav-links::-webkit-scrollbar-track {
    background: transparent;
}

.nav-links::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.nav-links::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

.nav-links a {
    margin-left: 0;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
}

body.sidebar-collapsed .nav-links a {
    padding: 12px;
    justify-content: center;
}

body.sidebar-collapsed .nav-links a span {
    display: none;
}

body.sidebar-collapsed .nav-links a svg,
body.sidebar-collapsed .nav-links a i {
    margin-right: 0 !important;
    font-size: 1.4em !important;
}

.nav-links a::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #60a5fa, #6366f1);
    opacity: 0;
    transition: all 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
    background-color: #eef2ff;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.12);
}

.nav-links a:hover::before, .nav-links a.active::before {
    height: 18px;
    opacity: 1;
}

/* Nav Groups */
.nav-item-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.nav-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    user-select: none;
    white-space: nowrap;
    position: relative;
}

body.sidebar-collapsed .nav-group-header {
    padding: 12px;
    justify-content: center;
}

body.sidebar-collapsed .nav-group-header span,
body.sidebar-collapsed .nav-group-header .arrow {
    display: none;
}

body.sidebar-collapsed .nav-group-header div > svg,
body.sidebar-collapsed .nav-group-header div > i {
    margin-right: 0 !important;
    font-size: 1.4em !important;
}

.nav-group-header::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #34d399, #22c55e);
    opacity: 0;
    transition: all 0.2s;
}

.nav-group-header:hover {
    color: var(--primary);
    background-color: #eef2ff;
    box-shadow: 0 6px 14px rgba(59, 130, 246, 0.12);
}

.nav-group-header:hover::before {
    height: 18px;
    opacity: 1;
}

/* Sidebar Styles */
body.sidebar-collapsed .nav-item-group {
    position: relative;
    overflow: visible !important;
    width: 100%;
}

body.sidebar-collapsed .nav-group-body {
    display: none !important; /* Force hide by default */
    position: absolute;
    left: 100%;
    top: 0;
    width: 200px;
    background: #ffffff;
    box-shadow: 4px 4px 15px rgba(0,0,0,0.15);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 0;
    z-index: 99999;
    margin-left: 0;
    max-height: none !important;
    overflow: visible !important;
    pointer-events: auto;
}

/* Show floating menu on hover when collapsed */
body.sidebar-collapsed .nav-item-group:hover .nav-group-body {
    display: flex !important;
}

/* Add a invisible bridge to keep the menu open while moving mouse to it */
body.sidebar-collapsed .nav-item-group:hover .nav-group-body::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0;
    width: 20px;
    height: 100%;
    z-index: -1;
}

body.sidebar-collapsed .nav-group-body a {
    padding: 10px 16px;
    justify-content: flex-start;
    display: flex;
    width: 100%;
    border-radius: 0;
}

body.sidebar-collapsed .nav-group-body a span {
    display: inline !important;
    margin-left: 8px;
}

body.sidebar-collapsed .nav-group-body a svg,
body.sidebar-collapsed .nav-group-body a i {
    font-size: 1.1em !important;
    margin-right: 0 !important;
}

#page-tabs {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

#page-tabs::-webkit-scrollbar {
    height: 4px;
}

#page-tabs::-webkit-scrollbar-track {
    background: transparent;
}

#page-tabs::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.nav-tab {
    position: relative;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    transform: translateY(0);
}

.nav-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(59, 130, 246, 0.18);
}

.nav-tab::after {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: -2px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #60a5fa, #6366f1);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nav-tab.active::after {
    opacity: 1;
}

.nav-group-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    padding-left: 0;
}

/* Removed redundant hide rule */
/* body.sidebar-collapsed .nav-group-body {
    display: none; 
} */

.nav-item-group.expanded .nav-group-body {
    max-height: 2000px;
} /* Approximate max height */

.nav-group-body a {
    padding-left: 32px; /* Indent for sub-items */
    font-size: 0.95rem;
}

.nav-item-group.expanded .nav-group-header .arrow {
    transform: rotate(180deg);
}

.nav-group-header .arrow {
    font-size: 1.2em;
    transition: transform 0.3s;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    width: 100%;
    height: 48px;
    margin-top: auto;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    background: #fff;
    flex-shrink: 0;
    position: relative;
    z-index: 101;
}

.sidebar-toggle:hover {
    color: var(--primary);
    background-color: #f8fafc;
}

.sidebar-toggle .toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: transform 0.3s;
}

body.sidebar-collapsed .sidebar-toggle {
    padding: 0;
}

body.sidebar-collapsed .sidebar-toggle .toggle-icon {
    transform: rotate(180deg);
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    margin-left: 0; /* Default: no sidebar */
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.layout-has-sidebar .main-wrapper {
    margin-left: 260px; /* Space for fixed sidebar */
}

body.sidebar-collapsed.layout-has-sidebar .main-wrapper {
    margin-left: 80px; /* Collapsed sidebar still has layout */
}

.top-header {
    background: white;
    padding: 16px 32px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    overflow: hidden; /* Ensure content doesn't spill out */
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crop to fill without distortion */
    display: block;
}

.user-name {
    margin-left: 10px;
    font-weight: 500;
}

.container {
    padding: 32px;
    width: 100%;
    box-sizing: border-box;
    max-width: 1200px;
    margin: 0 auto;
    flex: 1; /* Push footer down */
    display: flex;
    flex-direction: column;
}

/* Components */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

/* Global Input Styling to ensure consistency */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px; /* Consistent rounded corners */
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    appearance: none; /* Remove default styling */
    -webkit-appearance: none;
    background-color: white;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Specific styling for selects to add custom arrow */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    /* Inherit from global, just ensuring width */
    width: 100%;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: var(--primary-hover);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.btn-secondary {
    background-color: #64748b;
}

.btn-secondary:hover {
    background-color: #475569;
}

/* Table Styles */
.table-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible; /* Remove vertical scroll constraint */
    max-height: none; /* Remove height limit */
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 20px;
    position: relative; /* Context for sticky */
}

/* Full width container for Pool View */
.container-full {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px !important; /* Reduced padding */
    box-sizing: border-box;
    flex: 1; /* Push footer down */
}

table {
    width: max-content; /* Allow table to grow beyond container width */
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    white-space: nowrap; /* Force single line */
}

.resume-list-table tbody tr,
.latest-resumes-table tbody tr {
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.resume-list-table tbody td,
.latest-resumes-table tbody td {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.resume-list-table tbody tr:hover td,
.latest-resumes-table tbody tr:hover td {
    background-color: #eef2ff;
    box-shadow: inset 0 0 0 1px #c7d2fe;
}

.resume-list-table tbody tr:hover,
.latest-resumes-table tbody tr:hover {
    transform: translateY(-1px);
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    max-width: 400px; /* Increased limit for content */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
    background: #fff; /* Ensure background for sticky */
}

/* Sticky Columns */
.sticky-col-left-1 {
    position: sticky;
    left: 0;
    z-index: 15;
    border-right: 1px solid #f1f5f9;
}

.sticky-col-left-2 {
    position: sticky;
    left: 40px; /* Width of first column */
    z-index: 15;
    border-right: 1px solid #e2e8f0;
    box-shadow: 2px 0 5px -2px rgba(0,0,0,0.1); /* Shadow for separation */
}

.sticky-col-right {
    position: sticky;
    right: 0;
    z-index: 15;
    border-left: 1px solid #e2e8f0;
    box-shadow: -2px 0 5px -2px rgba(0,0,0,0.1);
}

/* Header Specifics */
th {
    font-weight: 600;
    color: var(--text-muted);
    background-color: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 20; /* Higher than content */
    box-shadow: 0 1px 0 #e2e8f0; /* Border for sticky header */
}

/* Sticky Header Intersections */
th.sticky-col-left-1, th.sticky-col-left-2, th.sticky-col-right {
    z-index: 30; /* Highest priority */
    background-color: #f8fafc; /* Match header bg */
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    align-items: center;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-item label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.filter-item select, .filter-item input {
    padding: 6px 10px;
    font-size: 0.9rem;
    min-width: 120px;
}

/* Tooltip on hover for truncated content - JS version handles display/copy */
.js-tooltip {
    position: fixed; /* Fixed to viewport to avoid overflow clipping */
    z-index: 9999;
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    white-space: normal;
    min-width: 200px;
    max-width: 400px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    display: none;
    pointer-events: auto; /* Allow interaction */
    word-break: break-all;
}

tr:last-child td {
    border-bottom: none;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-pending { background-color: #fef3c7; color: #b45309; }
.badge-assigned { background-color: #e0f2fe; color: #0284c7; }
.badge-interviewed { background-color: #ede9fe; color: #7c3aed; }
.badge-candidate { background-color: #cffafe; color: #0891b2; }
.badge-passed { background-color: #dcfce7; color: #16a34a; }
.badge-onboarded { background-color: #ecfeff; color: #0f766e; }
.badge-rejected { background-color: #fee2e2; color: #dc2626; }
.badge-trial_onboarding { background-color: #ffedd5; color: #ea580c; }
.badge-probation { background-color: #e0e7ff; color: #4338ca; }
.badge-active { background-color: #ecfccb; color: #4d7c0f; }
.badge-resigned { background-color: #f1f5f9; color: #64748b; }

/* Login Page Specific */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Print Styles */
@media print {
    @page {
        margin: 0.5cm; /* Reduced margin for single page */
        size: A4;
    }

    html, body {
        background: white;
        font-size: 10pt; /* Smaller font */
        color: #000;
        -webkit-print-color-adjust: exact;
        line-height: 1.3; /* Tighter line height */
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .main-wrapper {
        height: auto !important;
        min-height: 0 !important;
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Force Hide Navigation and Right Column Elements */
    .navbar, .top-header, .no-print, .btn, button, a[href^="/dashboard"], 
    .resume-right-column, .hr-info, .info-created-at, .badge, 
    .modal-overlay, #resumeEditModal, .career-preferences-content + div {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        width: 0 !important;
        opacity: 0 !important;
        position: absolute !important;
        overflow: hidden !important;
    }

    .container {
        max-width: 100%;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* Force Resume Layout to Full Width */
    .resume-layout {
        display: block !important;
        width: 100% !important;
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .resume-left-column {
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }

    /* Compact Typography */
    h2 {
        font-size: 14pt; /* Reduced from 16pt */
        margin-bottom: 2px;
        color: #000;
    }

    h3 {
        font-size: 11pt; /* Reduced from 12pt */
        margin-top: 5px; /* Reduced margin */
        margin-bottom: 3px;
        padding-bottom: 1px;
        border-bottom: 1px solid #000 !important;
        color: #000;
    }

    .form-group {
        margin-bottom: 2px !important;
        margin-top: 2px !important;
    }

    /* Compact Basic Info Grid */
    .basic-info-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important; 
        gap: 4px 8px !important; /* Reduced gap */
        margin-bottom: 5px !important;
        font-size: 9pt;
    }

    /* Compact Work Experience & Sections */
    .work-item, .personal-statement, .skills-section, .work-experience-item {
        padding: 4px 8px !important; /* Reduced padding */
        margin-bottom: 5px !important; /* Reduced margin */
        border-radius: 2px !important;
        background: #f8f9fa !important;
        border: 1px solid #eee !important;
    }

    .work-experience-item .company-row {
        margin-bottom: 2px !important;
    }
    
    .work-experience-item .company-name {
        font-size: 10pt !important;
        color: #000 !important;
    }

    .work-details-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important; /* Force 4 columns on print */
        gap: 4px !important;
        margin-top: 2px;
    }
    
    .work-details-grid > div {
        white-space: normal !important; /* Allow wrapping */
        font-size: 9pt;
    }

    .work-item div {
        font-size: 9pt;
        line-height: 1.2; /* Tighter line height */
    }

    /* Compact Tables */
    .table-responsive {
        margin-bottom: 5px !important;
    }

    th, td {
        padding: 1px 3px; /* Reduced cell padding */
    }

    /* Compact Career Preferences */
    .career-preferences-content {
        gap: 5px;
    }

    /* Reduce Signature Margin */
    .resume-footer {
        margin-top: 10px !important;
    }
}

/* Ranking Widget */
.ranking-container {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}
.ranking-section {
    flex: 1;
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.ranking-title {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #64748b;
}
.options-grid, .options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 50px;
}
.rank-item {
    background: white;
    border: 1px solid #cbd5e1;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.rank-item:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #eff6ff;
}
.rank-item .rank-number {
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    margin-right: 12px;
}
.rank-item.placeholder {
    background: transparent;
    border: 2px dashed #e2e8f0;
    color: #94a3b8;
    justify-content: center;
    cursor: default;
}
@media (max-width: 768px) {
    .ranking-container {
        flex-direction: column;
    }
}

/* Responsive Grid System */
.grid-row {
    display: grid;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.grid-3-cols {
    grid-template-columns: repeat(3, 1fr);
}

.grid-2-cols {
    grid-template-columns: repeat(2, 1fr);
}

/* Template rows specific styles */
.dynamic-row .grid-3-cols,
.dynamic-row .grid-2-cols {
    gap: 15px;
}

@media (max-width: 992px) {
    .grid-3-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-3-cols,
    .grid-2-cols {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .card {
        padding: 15px;
    }
    
    .container {
        padding: 15px;
    }
    
    /* Adjust dynamic rows padding on mobile */
    .dynamic-row {
        padding: 15px 10px !important; /* Override inline style if needed, but better to remove inline */
    }
}

/* Dropdown Menu */
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 180px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 8px 0;
    z-index: 50;
    margin-top: 10px;
    border: 1px solid #e2e8f0;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.dropdown-menu a:hover {
    background: #f8fafc;
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 8px 0;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    padding: 30px;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Avatar Preview */
.avatar-preview {
    width: 100px;
    height: 100px;
    background: var(--primary);
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 0.85rem;
    font-weight: 500;
}

.avatar-preview:hover .avatar-overlay {
    opacity: 1;
}
