/* watched.css - Style dla strony obserwowanych przetargów */

/* Container */
.watched-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 30px 30px;
}

/* Hidden helper */
.hidden {
    display: none !important;
}

/* Header */
.watched-header {
    margin-bottom: 24px;
}

.watched-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.watched-header h1 i {
    color: #f39c12;
}

.count-badge {
    font-size: 24px;
    font-weight: 600;
    color: #7f8c8d;
}

.watched-subtitle {
    font-size: 16px;
    color: #7f8c8d;
    margin: 0;
}

/* ========== STATUS TABS ========== */

.status-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    padding: 4px;
    background: #f8f9fa;
    border-radius: 12px;
}

.status-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.status-tab:hover {
    background: #e2e8f0;
    color: #475569;
}

.status-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.status-tab i {
    font-size: 14px;
}

.tab-count {
    font-size: 13px;
    opacity: 0.8;
}

/* Status tab colors when active */
.status-tab[data-status="active"].active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.status-tab[data-status="pending_results"].active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.status-tab[data-status="completed"].active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.status-tab[data-status="cancelled"].active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ========== STATUS BADGES IN CARDS ========== */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.status-badge i {
    font-size: 10px;
}

.status-active {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.status-pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.status-completed {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.status-cancelled {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

/* ========== DEADLINE STYLES ========== */

.deadline-value {
    font-weight: 600;
}

.deadline-value.warning {
    color: #d97706;
}

.deadline-value.urgent {
    color: #dc2626;
    font-weight: 700;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #7f8c8d;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top-color: #f39c12;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-state p {
    font-size: 16px;
    margin: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state i {
    font-size: 80px;
    color: #bdc3c7;
    margin-bottom: 24px;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 12px 0;
}

.empty-state p {
    font-size: 16px;
    color: #7f8c8d;
    margin: 0 0 32px 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.empty-state .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* Watched List - Grid */
.watched-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 24px;
}

/* Watched Card */
.watched-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.watched-card:hover {
    border-color: #f39c12;
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.15);
    transform: translateY(-2px);
}

.watched-card.has-results {
    border-color: #e67e22;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 50%);
}

/* Card border colors by status */
.watched-card.status-active {
    border-left: 4px solid #10b981;
}

.watched-card.status-pending_results {
    border-left: 4px solid #f59e0b;
}

.watched-card.status-completed {
    border-left: 4px solid #3b82f6;
}

.watched-card.status-cancelled {
    border-left: 4px solid #ef4444;
}

/* New Results Badge */
.new-results-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 0 12px 0 16px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(243, 156, 18, 0.5);
    }
}

.badge-date {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.9;
    margin-left: 4px;
}

/* Card Header */
.watched-card-header {
    margin-bottom: 20px;
    padding-right: 140px; /* Space for badge */
}

.watched-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    line-height: 1.4;
}

/* Card Body */
.watched-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    flex-grow: 1;
}

.watched-info-row {
    display: grid;
    grid-template-columns: 20px auto 1fr;
    gap: 8px;
    align-items: start;
    font-size: 14px;
}

.watched-info-row i {
    color: #7f8c8d;
    margin-top: 2px;
}

.info-label {
    color: #7f8c8d;
    font-weight: 500;
}

.info-value {
    color: #2c3e50;
    font-weight: 600;
    word-break: break-word;
}

/* Card Footer */
.watched-card-footer {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #ecf0f1;
    margin-top: auto;
}

.btn-view,
.btn-remove {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-view {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-view:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-remove {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.btn-remove:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 24px;
    right: 24px;
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    z-index: 100000;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-success {
    border-left: 4px solid #27ae60;
    color: #27ae60;
}

.toast-error {
    border-left: 4px solid #e74c3c;
    color: #e74c3c;
}

.toast-info {
    border-left: 4px solid #3498db;
    color: #3498db;
}

.toast-notification i {
    font-size: 20px;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 1200px) {
    .watched-list {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (max-width: 768px) {
    .watched-container {
        padding: 0.5rem;
    }
    
    /* Header kompaktowy */
    .watched-header {
        margin-bottom: 0.5rem;
        text-align: left;
    }
    
    .watched-header h1 {
        font-size: 1rem;
        gap: 0.4rem;
        flex-direction: row;
        align-items: center;
    }
    
    .watched-header h1 i {
        font-size: 0.9rem;
    }
    
    /* UKRYJ count badge (2) i subtitle */
    .count-badge,
    .watched-subtitle {
        display: none !important;
    }
    
    /* Tabs - tylko ikony */
    .status-tabs {
        padding: 0.25rem;
        gap: 0.25rem;
        margin-bottom: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }
    
    .status-tab {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
        flex: 1;
        justify-content: center;
        min-width: auto;
    }
    
    .tab-label,
    .tab-count {
        display: none !important;
    }
    
    .status-tab i {
        font-size: 0.85rem;
        margin: 0;
    }
    
    /* Lista kart */
    .watched-list {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    /* Karty SUPER kompaktowe */
    .watched-card {
        padding: 0.6rem;
        min-height: auto;
        border-radius: 8px;
    }
    
    .watched-card-header {
        padding-right: 0;
        margin-bottom: 0.3rem;
    }
    
    /* Status badge mały */
    .status-badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.5rem;
        margin-bottom: 0.3rem;
    }
    
    /* Tytuł - max 2 linie */
    .watched-title {
        font-size: 0.85rem;
        line-height: 1.25;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* Info rows kompaktowe */
    .watched-card-body {
        gap: 0.3rem;
        margin-bottom: 0.4rem;
    }
    
    .watched-info-row {
        font-size: 0.75rem;
        gap: 0.3rem;
        grid-template-columns: 16px auto 1fr;
    }
    
    .watched-info-row i {
        font-size: 0.7rem;
    }
    
    /* Zamawiający - 1 linia */
    .info-value {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Footer kompaktowy */
    .watched-card-footer {
        flex-direction: row;
        gap: 0.4rem;
        padding-top: 0.4rem;
    }
    
    .btn-view,
    .btn-remove {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
        gap: 0.3rem;
    }
    
    .btn-view i,
    .btn-remove i {
        font-size: 0.7rem;
    }
    
    /* New results badge mniejszy */
    .new-results-badge {
        font-size: 0.55rem;
        padding: 0.25rem 0.5rem;
        border-radius: 0 8px 0 8px;
    }
    
    .badge-date {
        display: none;
    }
    
    .toast-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
    }
}

/* iPhone SE */
@media (max-width: 375px) {
    .watched-container {
        padding: 0.4rem;
    }
    
    .watched-header h1 {
        font-size: 0.95rem;
    }
    
    .status-tab {
        padding: 0.35rem 0.4rem;
    }
    
    .watched-card {
        padding: 0.5rem;
    }
    
    .watched-title {
        font-size: 0.8rem;
    }
    
    .watched-info-row {
        font-size: 0.7rem;
    }
    
    .btn-view,
    .btn-remove {
        padding: 0.35rem 0.5rem;
        font-size: 0.65rem;
    }
}

/* ========== DARK MODE ========== */

body.dark-theme {
    background: #0f1419;
    color: #e4e4e7;
}

body.dark-theme .watched-container {
    background: #0f1419;
}

body.dark-theme .watched-header h1 {
    color: #e4e4e7;
}

body.dark-theme .watched-subtitle {
    color: #a1a1aa;
}

/* Dark mode tabs */
body.dark-theme .status-tabs {
    background: #1a1f2e;
}

body.dark-theme .status-tab {
    color: #a1a1aa;
}

body.dark-theme .status-tab:hover {
    background: #2d3748;
    color: #e4e4e7;
}

body.dark-theme .status-tab.active {
    color: white;
}

/* Dark mode status badges */
body.dark-theme .status-active {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    color: #a7f3d0;
}

body.dark-theme .status-pending {
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
    color: #fde68a;
}

body.dark-theme .status-completed {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #bfdbfe;
}

body.dark-theme .status-cancelled {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    color: #fecaca;
}

/* Dark mode loading/empty */
body.dark-theme .loading-state {
    color: #a1a1aa;
}

body.dark-theme .spinner {
    border-color: #2d3748;
    border-top-color: #f39c12;
}

body.dark-theme .empty-state i {
    color: #52525b;
}

body.dark-theme .empty-state h3 {
    color: #e4e4e7;
}

body.dark-theme .empty-state p {
    color: #a1a1aa;
}

/* Dark mode cards */
body.dark-theme .watched-card {
    background: #1a1f2e;
    border-color: #2d3748;
}

body.dark-theme .watched-card:hover {
    border-color: #f39c12;
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.25);
}

body.dark-theme .watched-card.has-results {
    border-color: #e67e22;
    background: linear-gradient(135deg, #1a1f2e 0%, #1a1f2e 50%);
}

body.dark-theme .watched-title {
    color: #e4e4e7;
}

body.dark-theme .info-label {
    color: #a1a1aa;
}

body.dark-theme .info-value {
    color: #e4e4e7;
}

body.dark-theme .watched-card-footer {
    border-top-color: #2d3748;
}

/* Dark mode deadline */
body.dark-theme .deadline-value.warning {
    color: #fbbf24;
}

body.dark-theme .deadline-value.urgent {
    color: #f87171;
}

/* Dark mode toasts */
body.dark-theme .toast-notification {
    background: #1a1f2e;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    color: #e4e4e7;
}

body.dark-theme .toast-success {
    border-left-color: #34d399;
    color: #34d399;
}

body.dark-theme .toast-error {
    border-left-color: #f87171;
    color: #f87171;
}

body.dark-theme .toast-info {
    border-left-color: #60a5fa;
    color: #60a5fa;
}

body.dark-theme .count-badge {
    color: #a1a1aa;
}