/* Mobile-First Job Cards CSS */

/* Mobile Header */
.mobile-header {
    background: #0D47A1;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mobile-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    height: 56px;
}

/* Hamburger Menu Button */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Logo */
.mobile-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Mobile Actions */
.mobile-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: none;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 201;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-header {
    background: linear-gradient(135deg, #0D47A1 0%, #1565C0 100%);
    padding: 1.5rem;
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.user-email {
    font-size: 0.85rem;
    opacity: 0.9;
}

.mobile-menu-nav {
    padding: 1rem 0;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.mobile-menu-item:hover {
    background: #f5f5f5;
}

.mobile-menu-item.active {
    background: #e3f2fd;
    color: #0D47A1;
    border-left: 3px solid #0D47A1;
}

.menu-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.menu-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 0.5rem 0;
}

/* Page Layout */
.main-content {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: calc(56px + 1rem); /* Account for sticky header */
}

.page-header {
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.btn-refresh {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.btn-refresh:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-refresh.refreshing .refresh-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Pull-to-refresh indicator */
.pull-to-refresh-indicator {
    position: absolute;
    top: -60px;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #f8f9fa;
    color: var(--text-secondary);
    transition: all 0.3s;
    opacity: 0;
    z-index: 10;
}

.pull-to-refresh-indicator.ready {
    background: #e8f5e8;
    color: #2e7d32;
}

.pull-icon {
    font-size: 1.2rem;
}

.pull-icon.spinning {
    animation: spin 1s linear infinite;
}

/* Filter Section */
.filter-section {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sort-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 1rem;
}

/* Responsive layout for 5 buttons */
@media (min-width: 400px) {
    .sort-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .sort-btn:nth-child(4),
    .sort-btn:nth-child(5) {
        grid-column: span 1;
    }
    
    .sort-btn:nth-child(5) {
        grid-column: 2 / 3;
    }
}

@media (min-width: 600px) {
    .sort-buttons {
        grid-template-columns: repeat(5, 1fr);
        max-width: 600px;
        margin: 0 auto 1rem;
    }
    
    .sort-btn:nth-child(4),
    .sort-btn:nth-child(5) {
        grid-column: span 1;
    }
}

.sort-btn {
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 14px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sort-btn .icon {
    font-size: 18px;
    line-height: 1;
}

.sort-direction {
    font-size: 12px;
    font-weight: 700;
    margin-left: 2px;
}

.sort-btn.active {
    background: #0D47A1;
    color: white;
    border-color: #0D47A1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.3);
}

.sort-btn:hover {
    background: #f8f9fa;
    border-color: #0D47A1;
    transform: translateY(-1px);
}

.sort-btn.active:hover {
    background: #1565c0;
    border-color: #1565c0;
}

.results-count {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-chip {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: var(--primary-color);
}

.filter-chip.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Job Cards */
.jobs-container {
    display: grid;
    gap: 1rem;
}

.job-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.job-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

.job-header {
    margin-bottom: 1rem;
}

.job-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.company-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.company-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.company-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rating-reason {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.25rem;
    line-height: 1.3;
}

.job-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin: 0.5rem 0;
    flex-wrap: wrap;
}

.match-badge {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.stage-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.stage-badge:hover {
    transform: scale(1.05);
    opacity: 0.8;
}

.stage-badge:active {
    transform: scale(0.95);
}

/* Stage-specific styling (same as desktop dashboard) */
.stage-badge.stage-not-applied {
    background: #f5f5f5;
    color: #666;
}

.stage-badge.stage-applied {
    background: #e3f2fd;
    color: #0D47A1;
}

.stage-badge.stage-recruiter-contacted {
    background: #fff3e0;
    color: #ff6f00;
}

.stage-badge.stage-interview-scheduled {
    background: #fce4ec;
    color: #c2185b;
}

.stage-badge.stage-interview-done {
    background: #f3e5f5;
    color: #7b1fa2;
}

.stage-badge.stage-got-offer {
    background: #e8f5e9;
    color: #2e7d32;
}

.stage-badge.stage-no-offer {
    background: #ffebee;
    color: #c62828;
}

.created-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stars {
    display: flex;
    gap: 1px;
}

.star {
    color: #FF8C00;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
    font-size: 0.9rem;
}

.star.empty {
    color: #e0e0e0;
}

.rating-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 0.25rem;
}

.job-summary {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.salary {
    font-size: 1.1rem;
    font-weight: 600;
    color: #28a745;
}

.location {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.job-type {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    width: fit-content;
}

.job-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-apply {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-apply:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-details {
    background: transparent;
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-details:hover {
    background: var(--primary-color);
    color: white;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(50px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: flex-end;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f8f9fa;
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
}

.job-detail-header {
    margin-bottom: 2rem;
}

.job-detail-header h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.company-detail h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.company-rating-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.rating-score {
    font-weight: 600;
    color: var(--text-primary);
}

.rating-reason {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.compensation-breakdown {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
}

.salary-range {
    font-size: 1.2rem;
    font-weight: 600;
    color: #28a745;
    margin-bottom: 0.5rem;
}

.total-comp {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.job-meta {
    display: grid;
    gap: 0.75rem;
}

.meta-item {
    display: flex;
    gap: 0.5rem;
}

.meta-item strong {
    min-width: 100px;
    color: var(--text-primary);
}

.job-description {
    line-height: 1.6;
    color: var(--text-primary);
}

.job-description p {
    margin-bottom: 1rem;
}

.skills-match {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
}

.skill-tag.match {
    background: #e8f5e8;
    color: #2e7d32;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #e1e5e9;
}

/* Loading & Empty States */
.loading-state, .empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e1e5e9;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .main-content {
        padding: 0.5rem;
    }
    
    .sort-buttons {
        gap: 10px;
    }
    
    .sort-btn {
        min-height: 55px;
        padding: 12px 10px;
        font-size: 12px;
    }
    
    .sort-btn .icon {
        font-size: 16px;
    }
    
    .results-count {
        text-align: center;
    }
    
    .job-card {
        padding: 1rem;
    }
    
    .job-title {
        font-size: 1.1rem;
    }
    
    .company-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .job-actions {
        flex-direction: column;
    }
    
    .btn-apply, .btn-details {
        width: 100%;
        text-align: center;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .jobs-container {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }
}

/* Desktop Optimizations */
@media (min-width: 1025px) {
    .jobs-container {
        grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    }
    
    .filter-chips {
        justify-content: center;
    }
}

/* Swipe to Delete Styles */
.job-card-wrapper {
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
}

.job-card-swipe-container {
    position: relative;
    transition: transform 0.3s ease;
    will-change: transform;
    z-index: 2;
}

.swipe-delete-background {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100px;
    background: linear-gradient(to left, #dc3545, #ff6b6b);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-delete {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 600;
    padding: 1rem;
    cursor: pointer;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-icon {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-delete-icon:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-delete-icon:active {
    transform: scale(0.95);
}

/* Ensure job card has relative positioning for the delete button */
.job-card {
    position: relative;
    background: white;
}

.job-header {
    position: relative;
    padding-right: 3rem; /* Make room for delete button */
}

/* Animation for card removal */
.job-card-wrapper.removing {
    animation: slideOutLeft 0.3s ease forwards;
}

@keyframes slideOutLeft {
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* Touch feedback */
.job-card-swipe-container.swiping {
    transition: none !important;
}

/* Prevent text selection during swipe */
.job-card-wrapper * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}