/* favorites.css */

/* Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* Page Header */
.page-header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-btn {
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.back-btn:hover {
    background: #218838;
    color: white;
    text-decoration: none;
}

/* Tabs */
.tabs {
    display: flex;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.tab {
    flex: 1;
    padding: 15px 20px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.tab.active {
    background: #28a745;
    color: white;
}

.tab:hover:not(.active) {
    background: #e9ecef;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Favorites Grid */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    /* Make each row equal height so cards can stretch to match */
    grid-auto-rows: 1fr;
    align-items: stretch;
}

.favorite-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.favorite-card.modern-card {
    /* explicit modern variant (keeps compatibility) */
    display: flex;
    flex-direction: column;
    height: 100%;
    align-self: stretch;
}

.favorite-card:hover {
    transform: translateY(-5px);
}

.card-main {
    display: flex;
    flex-direction: column;
    min-height: 0; /* allow proper flexbox clipping */
    flex: 1 1 auto;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.card-header { min-height: 84px; box-sizing: border-box; }

.card-body { padding: 20px; flex: 1 1 auto; }

.card-footer { padding: 15px 20px; background: #f8f9fa; display: flex; justify-content: space-between; align-items: center; margin-top: auto; }

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.card-top-left { min-height: 56px; }
.card-top-left .job-title { margin: 0 0 6px 0; }
.card-top-right { text-align: right; color: #0b76a8; font-weight: 600; }
.job-sub { color: #6b7280; font-size: 0.95rem; }

.job-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0 0 10px 0;
    /* clamp title to 2 lines with ellipsis to avoid layout break on long titles */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.company-name {
    color: #28a745;
    font-weight: 500;
    margin: 0 0 5px 0;
}

.job-meta {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.card-body {
    padding: 20px;
}

.job-description {
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-description {
    color: #374151;
    margin-top: 10px;
    line-height: 1.4;
    /* clamp to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.job-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-actions-row {
    margin-top: auto;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.favorite-date {
    color: #666;
    font-size: 12px;
}

.card-actions {
    display: flex;
    gap: 10px;
}

/* Company Card */
.company-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    text-align: center;
}

.company-logo {
    width: 80px;
    height: 80px;
    background: #f8f9fa;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #28a745;
}

.company-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.company-info {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.company-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
}

.company-stat {
    text-align: center;
}

.company-stat-number {
    font-size: 18px;
    font-weight: bold;
    color: #28a745;
}

.company-stat-label {
    font-size: 12px;
    color: #666;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.empty-state i {
    font-size: 4em;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.empty-state p {
    margin: 0 0 20px 0;
}

/* Buttons */
.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    color: white;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .page-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .favorites-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .card-footer {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .card-actions {
        justify-content: center;
    }
    
    .company-stats {
        flex-direction: column;
        gap: 10px;
    }
}

