/* ============================================
   JOB PORTAL - PROFESSIONAL RESPONSIVE STYLES
   ============================================ */

/* CSS Variables */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    font-size: 16px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    padding: 4rem 0;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

/* ============================================
   INFO BAR
   ============================================ */
.info-bar {
    background: white;
    padding: 2rem 0;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
    margin-top: -2rem;
    position: relative;
    z-index: 10;
}

.info-bar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.stat:hover {
    background: var(--gray-50);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.stat-text h4 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    line-height: 1;
}

.stat-text p {
    margin: 0.25rem 0 0 0;
    color: var(--gray-600);
    font-size: 0.9375rem;
    font-weight: 500;
}

/* ============================================
   SEARCH SECTION
   ============================================ */
.search-section {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.form-control-lg,
.form-select-lg {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: var(--radius);
    border: 2px solid var(--gray-200);
    transition: var(--transition);
}

.form-control-lg:focus,
.form-select-lg:focus,
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

.form-control::placeholder {
    color: var(--gray-400);
}

/* ============================================
   ACTIVE FILTERS
   ============================================ */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
}

.remove-filter {
    cursor: pointer;
    font-size: 1.125rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.remove-filter:hover {
    opacity: 1;
}

/* ============================================
   RESULTS HEADER
   ============================================ */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.results-count {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
}

.sort-dropdown {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sort-dropdown label {
    margin: 0;
    font-weight: 500;
    color: var(--gray-600);
}

.sort-dropdown .form-select {
    width: auto;
    min-width: 180px;
}

/* ============================================
   JOB CARDS
   ============================================ */
.job-card {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--gray-200);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.job-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.job-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.company-logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
}

.job-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.job-card-subtitle {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
    font-weight: 500;
}

.job-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.job-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.job-badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.job-badge-teal {
    background: #ccfbf1;
    color: #115e59;
}

.job-badge-green {
    background: #d1fae5;
    color: #065f46;
}

.job-badge-purple {
    background: #e9d5ff;
    color: #6b21a8;
}

.job-badge-orange {
    background: #fed7aa;
    color: #9a3412;
}

.job-card-text {
    color: var(--gray-600);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.posted-date {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.deadline-urgent {
    color: var(--danger);
    font-weight: 600;
}

.deadline-warning {
    color: var(--warning);
    font-weight: 600;
}

.deadline-normal {
    color: var(--info);
}

.btn-apply {
    display: block;
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-apply:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 100;
    border-radius: var(--radius-xl);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    color: var(--gray-600);
    font-weight: 500;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.empty-state-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet */
@media (max-width: 991px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .info-bar-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .stat-icon {
        font-size: 2.5rem;
    }
    
    .stat-text h4 {
        font-size: 1.75rem;
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .sort-dropdown {
        width: 100%;
    }
    
    .sort-dropdown .form-select {
        flex-grow: 1;
        min-width: 0;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .hero-section {
        padding: 3rem 0;
        margin-bottom: 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .info-bar {
        margin-top: -1rem;
        padding: 1.5rem 0;
        margin-bottom: 2rem;
    }
    
    .info-bar-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .stat {
        padding: 0.75rem;
    }
    
    .search-section {
        padding: 1.5rem;
        border-radius: var(--radius-lg);
    }
    
    .form-control-lg,
    .form-select-lg {
        font-size: 0.9375rem;
    }
    
    .results-header {
        padding: 1rem;
    }
    
    .job-card-body {
        padding: 1.25rem;
    }
    
    .company-logo {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .job-card-title {
        font-size: 1.125rem;
    }
    
    .active-filters {
        margin-top: 1rem;
        padding-top: 1rem;
    }
    
    .filter-pill {
        font-size: 0.8125rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Small Mobile */
@media (max-width: 575px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .stat-text h4 {
        font-size: 1.5rem;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .job-info {
        gap: 0.375rem;
    }
    
    .job-badge {
        font-size: 0.6875rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Print Styles */
@media print {
    .hero-section,
    .search-section,
    .results-header,
    .loading-overlay {
        display: none;
    }
    
    .job-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
