/* ============================================
   GKK-HIRE ADMIN - PROFESSIONAL CORPORATE THEME
   Inspired by: LinkedIn Talent, Workday, Notion
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Professional Color Palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f5;
    --bg-card: #ffffff;
    --bg-hover: #f8f9fa;

    /* Accent - Professional Blue */
    --accent-primary: #2563eb;
    --accent-secondary: #1e40af;
    --accent-light: #dbeafe;
    --accent-hover: #1d4ed8;

    /* Status Colors */
    --success: #16a34a;
    --success-bg: #dcfce7;
    --warning: #ea580c;
    --warning-bg: #fed7aa;
    --error: #dc2626;
    --error-bg: #fee2e2;
    --info: #0891b2;
    --info-bg: #cffafe;

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    /* Borders */
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;

    /* 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-card: 0 1px 3px 0 rgba(0, 0, 0, 0.1);

    /* Spacing */
    --sidebar-width: 240px;
    --header-height: 64px;
    --radius: 8px;

    /* Transitions */
    --transition: 150ms ease;
}

/* ============================================
   BASE
   ============================================ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* 3D Background Elements */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.4;
}

/* ============================================
   LAYOUT
   ============================================ */

.admin-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Antigravity Background - ensure it's behind content */
#antigravity-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.sidebar-logo-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    color: var(--text-secondary);
    border-radius: var(--radius);
    transition: all var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--accent-light);
    color: var(--accent-primary);
    font-weight: 600;
}

.nav-link-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-link-badge {
    margin-left: auto;
    background: var(--error);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: background var(--transition);
}

.user-profile:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.main-header {
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    position: relative;
}

.header-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.header-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: var(--error);
    border-radius: 50%;
    font-size: 0.625rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-content {
    padding: 2rem;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    transition: all var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: all var(--transition);
    /* 3D Transform on Hover */
    transform-style: preserve-3d;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.stat-icon.purple {
    background: #ede9fe;
    color: #7c3aed;
}

.stat-icon.blue {
    background: #dbeafe;
    color: #2563eb;
}

.stat-icon.green {
    background: var(--success-bg);
    color: var(--success);
}

.stat-icon.orange {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.input-with-icon {
    position: relative;
    width: 100%;
}

.input-with-icon .input-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.875rem;
}

.input-with-icon.left .form-input {
    padding-left: 2.5rem;
}

.input-with-icon.left .input-icon {
    left: 1rem;
}

.input-with-icon.right .form-input {
    padding-right: 2.5rem;
}

.input-with-icon.right .input-icon {
    right: 1rem;
}

/* ============================================
   TABLES
   ============================================ */

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-secondary);
}

.table td {
    font-size: 0.875rem;
}

.table tbody tr {
    transition: background var(--transition);
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 12px;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-error {
    background: var(--error-bg);
    color: var(--error);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-neutral {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* ============================================
   TEAM MANAGEMENT
   ============================================ */

.teams-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
}

.candidates-pool {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    max-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

.candidates-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.candidates-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.candidates-count {
    background: var(--accent-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
}

.candidates-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.candidate-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.875rem;
    margin-bottom: 0.5rem;
    cursor: move;
    transition: all var(--transition);
    /* 3D Effect */
    transform: perspective(1000px) rotateX(0deg);
}

.candidate-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
    transform: perspective(1000px) rotateX(2deg) translateY(-2px);
}

.candidate-card.dragging {
    opacity: 0.5;
}

.candidate-name {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.candidate-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.skill-tag {
    background: var(--accent-light);
    color: var(--accent-primary);
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    align-content: start;
}

.team-card {
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    min-height: 200px;
    transition: all var(--transition);
    /* 3D Card */
    transform-style: preserve-3d;
}

.team-card:hover {
    box-shadow: var(--shadow-md);
}

.team-card.drag-over {
    border-color: var(--accent-primary);
    background: var(--accent-light);
}

.team-card.full {
    border-style: solid;
    border-color: var(--success);
}

.team-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.team-name {
    font-size: 1rem;
    font-weight: 600;
}

.team-members {
    padding: 0.75rem;
    min-height: 120px;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

/* ============================================
   MODALS
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1rem;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--error);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ============================================
   TOASTS
   ============================================ */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    border-left: 3px solid var(--success);
}

.toast-error {
    border-left: 3px solid var(--error);
}

/* ============================================
   MOBILE MENU COMPONENTS
   ============================================ */

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-overlay.active {
    opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    }

    .main-content {
        margin-left: 0;
    }

    .main-header {
        padding: 0 1.5rem;
    }

    .header-btn {
        display: none;
    }

    #menuToggle {
        display: flex !important;
    }

    .teams-layout {
        grid-template-columns: 1fr;
    }

    .candidates-pool {
        max-height: 400px;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    .mobile-overlay {
        display: block;
    }

    .page-content {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .main-header {
        padding: 0 1rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    /* Make tables horizontally scrollable */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius);
        box-shadow: var(--shadow-sm);
    }

    .table {
        min-width: 600px;
    }

    /* Card adjustments */
    .card-header {
        padding: 1rem 1.25rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .card-body {
        padding: 1.25rem;
    }

    /* Button groups */
    .header-right,
    .card-header>div {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Form improvements */
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px;
        /* Prevent zoom on iOS */
        min-height: 44px;
    }

    .btn {
        min-height: 44px;
    }

    /* Quick actions */
    .card-body {
        gap: 0.75rem;
    }

    .btn-secondary,
    .btn-primary {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 140px;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 0.75rem;
    }

    .main-header {
        padding: 0 0.75rem;
    }

    .page-title {
        font-size: 1.125rem;
    }

    /* Stack stat cards */
    .stat-card {
        padding: 1.25rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    /* Sidebar tweaks when open */
    .sidebar {
        width: 280px;
        max-width: 85vw;
    }

    .sidebar-header,
    .sidebar-footer {
        padding: 1rem;
    }

    /* Make buttons full width on very small screens */
    .btn-secondary,
    .btn-primary {
        flex: 1 1 100%;
    }

    /* Card spacing */
    .card {
        margin-bottom: 1rem;
    }

    .card-header {
        padding: 0.875rem 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Table font size */
    .table th,
    .table td {
        font-size: 0.8125rem;
        padding: 0.75rem 0.875rem;
    }
}

@media (max-width: 375px) {

    /* iPhone SE and smaller */
    .sidebar {
        width: 260px;
    }

    .page-content {
        padding: 0.5rem;
    }

    .stats-grid {
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem;
    }

    .card-body {
        padding: 0.875rem;
    }

    /* Smaller fonts */
    .page-title {
        font-size: 1rem;
    }

    .card-title {
        font-size: 0.9375rem;
    }

    .stat-value {
        font-size: 1.375rem;
    }
}