/* ============================================================
   PROFESSIONAL TENDER DETAIL REDESIGN
   Muted colors, clean layout, perfect responsiveness
   ============================================================ */

/* Professional Color Palette - Muted & Clean */
:root {
    --tp-slate-50: #f8fafc;
    --tp-slate-100: #f1f5f9;
    --tp-slate-200: #e2e8f0;
    --tp-slate-300: #cbd5e1;
    --tp-slate-400: #94a3b8;
    --tp-slate-500: #64748b;
    --tp-slate-600: #475569;
    --tp-slate-700: #334155;
    --tp-slate-800: #1e293b;
    --tp-slate-900: #0f172a;

    --tp-blue-50: #eff6ff;
    --tp-blue-100: #dbeafe;
    --tp-blue-500: #3b82f6;
    --tp-blue-600: #2563eb;
    --tp-blue-700: #1d4ed8;

    --tp-amber-50: #fffbeb;
    --tp-amber-100: #fef3c7;
    --tp-amber-500: #f59e0b;
    --tp-amber-600: #d97706;

    --tp-rose-50: #fff1f2;
    --tp-rose-100: #ffe4e6;
    --tp-rose-500: #f43f5e;
    --tp-rose-600: #e11d48;

    --tp-emerald-50: #ecfdf5;
    --tp-emerald-100: #d1fae5;
    --tp-emerald-500: #10b981;
    --tp-emerald-600: #059669;
}

/* Global Page Styling */
.tpsub-detail-page {
    background: var(--tp-slate-50);
    padding: 32px 20px 60px !important;
}

.tpsub-tender-detail {
    max-width: 1400px !important;
    margin: 0 auto;
    padding: 0 !important;
}

/* Header Redesign - Clean & Professional */
.tpsub-detail-header {
    background: white;
    border: 1px solid var(--tp-slate-200);
    border-left: 4px solid var(--tp-blue-600);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 32px;
}

.tpsub-header-top {
    margin-bottom: 16px;
}

.tpsub-reference {
    font-size: 13px;
    font-weight: 600;
    color: var(--tp-slate-600);
    background: var(--tp-slate-100);
    padding: 6px 12px;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

.tpsub-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.tpsub-badge-type {
    background: var(--tp-blue-100);
    color: var(--tp-blue-700);
    border: 1px solid var(--tp-blue-200);
}

.tpsub-badge-open {
    background: var(--tp-emerald-100);
    color: var(--tp-emerald-700);
    border: 1px solid var(--tp-emerald-200);
}

.tpsub-badge-open::before {
    content: "";
}

.tpsub-badge-closed {
    background: var(--tp-rose-100);
    color: var(--tp-rose-700);
    border: 1px solid var(--tp-rose-200);
}

.tpsub-badge-closed::before {
    content: "";
}

.tpsub-detail-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--tp-slate-900);
    margin: 0 0 20px 0;
    background: none;
    -webkit-text-fill-color: inherit;
}

/* Action Buttons - Muted Professional Style */
.tpsub-star-btn,
.tpsub-send-email-btn,
.tpsub-share-btn,
.tpsub-ai-workspace-btn,
a.tpsub-ai-workspace-btn {
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.tpsub-star-btn {
    background: var(--tp-slate-700);
    color: white;
    border-color: var(--tp-slate-700);
}

.tpsub-star-btn:hover {
    background: var(--tp-slate-800);
    border-color: var(--tp-slate-800);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tpsub-star-btn.starred {
    background: var(--tp-amber-500);
    border-color: var(--tp-amber-600);
    animation: none;
}

.tpsub-star-btn.starred:hover {
    background: var(--tp-amber-600);
}

.tpsub-send-email-btn {
    background: var(--tp-blue-600);
    color: white;
    border-color: var(--tp-blue-600);
}

.tpsub-send-email-btn:hover {
    background: var(--tp-blue-700);
    border-color: var(--tp-blue-700);
    transform: translateY(-1px);
}

.tpsub-ai-workspace-btn,
a.tpsub-ai-workspace-btn,
a.tpsub-ai-workspace-btn:link,
a.tpsub-ai-workspace-btn:visited {
    background: var(--tp-emerald-600);
    color: white !important;
    border-color: var(--tp-emerald-600);
}

.tpsub-ai-workspace-btn:hover,
a.tpsub-ai-workspace-btn:hover {
    background: var(--tp-emerald-700);
    border-color: var(--tp-emerald-700);
    transform: translateY(-1px);
}

.tpsub-share-btn {
    background: white;
    color: var(--tp-slate-700);
    border-color: var(--tp-slate-300);
}

.tpsub-share-btn:hover {
    background: var(--tp-slate-50);
    border-color: var(--tp-slate-400);
}

/* Layout - Professional 2-Column Grid */
.tpsub-detail-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 32px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Sidebar - Sticky & Clean */
.tpsub-quick-sidebar {
    position: relative;
}

.tpsub-quick-panel {
    position: sticky;
    top: 20px;
    background: white;
    border: 1px solid var(--tp-slate-200);
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.tpsub-quick-panel h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--tp-slate-600);
    margin: 0;
    padding: 16px 20px;
    background: var(--tp-slate-50);
    border-bottom: 1px solid var(--tp-slate-200);
}

/* Quick Navigation Links */
.tpsub-quick-nav ul {
    list-style: none;
    padding: 12px;
    margin: 0;
}

.tpsub-quick-nav li {
    margin-bottom: 2px;
}

.tpsub-nav-link {
    display: block;
    padding: 8px 12px;
    color: var(--tp-slate-600);
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.tpsub-nav-link:hover {
    background: var(--tp-slate-100);
    color: var(--tp-slate-900);
}

.tpsub-nav-link.active {
    background: var(--tp-blue-50);
    color: var(--tp-blue-700);
    font-weight: 600;
}

/* Countdown Widget - Professional */
.tpsub-time-widget {
    padding: 16px 20px;
    border-top: 1px solid var(--tp-slate-200);
}

.tpsub-countdown-large {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--tp-amber-50) 0%, var(--tp-amber-100) 100%);
    border-radius: 8px;
    border: 1px solid var(--tp-amber-200);
}

.tpsub-countdown-large .days {
    display: block;
    font-size: 36px;
    font-weight: 800;
    color: var(--tp-amber-600);
    line-height: 1;
}

.tpsub-countdown-large .label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--tp-amber-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

/* Analytics Widget - Professional Blue Theme */
.tpsub-analytics-widget {
    margin-top: 20px;
    background: white;
    border: 1px solid var(--tp-slate-200);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tpsub-analytics-header {
    background: #0f172a;
    padding: 16px 20px;
    color: #ffffff;
    position: relative;
    z-index: 2;
}

.tpsub-analytics-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.8px;
}

.tpsub-analytics-content {
    padding: 20px;
}

.stat-icon {
    font-size: 18px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--tp-slate-900);
}

.stat-label {
    font-size: 11px;
    color: var(--tp-slate-500);
    font-weight: 600;
}

.stat-range {
    font-size: 10px;
    color: var(--tp-slate-400);
}

/* Competition Section */
.tpsub-competition-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--tp-slate-200);
}

.competition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.competition-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--tp-slate-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.competition-badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.competition-low {
    background: var(--tp-emerald-100);
    color: var(--tp-emerald-700);
}

.competition-medium {
    background: var(--tp-amber-100);
    color: var(--tp-amber-700);
}

.competition-high {
    background: var(--tp-rose-100);
    color: var(--tp-rose-700);
}

.competition-score {
    margin-bottom: 12px;
}

.score-bar {
    height: 8px;
    background: var(--tp-slate-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tp-blue-500) 0%, var(--tp-blue-600) 100%);
    transition: width 0.6s ease;
}

.score-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--tp-slate-600);
    text-align: right;
}

.competition-recommendation {
    font-size: 12px;
    color: var(--tp-slate-600);
    line-height: 1.6;
    padding: 12px;
    background: var(--tp-slate-50);
    border-radius: 6px;
    border-left: 3px solid var(--tp-blue-500);
}

/* Main Content Area - Professional Cards */
.tpsub-detail-main {
    min-width: 0;
}

.tpsub-detail-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Info Panels - Clean Card Design */
.tpsub-info-panel,
.tpsub-dates-panel,
.tpsub-description-panel {
    background: white;
    border: 1px solid var(--tp-slate-200);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tpsub-info-panel h2,
.tpsub-dates-panel h2,
.tpsub-description-panel h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--tp-slate-900);
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--tp-slate-200);
}

/* Key Information Grid - Clean Card Layout */
.tpsub-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin: 0;
}

.tpsub-info-card {
    background: var(--tp-slate-50);
    border: 1px solid var(--tp-slate-200);
    border-radius: 6px;
    padding: 16px;
    transition: all 0.2s ease;
}

.tpsub-info-card:hover {
    background: white;
    border-color: var(--tp-slate-300);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tpsub-info-card.tpsub-info-highlight {
    background: linear-gradient(135deg, var(--tp-blue-50) 0%, var(--tp-slate-50) 100%);
    border-color: var(--tp-blue-200);
}

.tpsub-info-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--tp-slate-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.tpsub-info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--tp-slate-900);
    line-height: 1.4;
    word-break: break-word;
}

.tpsub-info-highlight .tpsub-info-value {
    font-size: 16px;
    color: var(--tp-blue-700);
}

/* Dates Panel Styling */
.tpsub-dates-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
}

.tpsub-dates-list dt {
    font-size: 11px;
    font-weight: 700;
    color: var(--tp-slate-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.tpsub-dates-list dd {
    font-size: 14px;
    font-weight: 600;
    color: var(--tp-slate-900);
    margin: 0 0 12px 0;
    padding-left: 12px;
    border-left: 3px solid var(--tp-slate-300);
}

.tpsub-closing-date-highlight {
    padding: 12px;
    background: var(--tp-rose-50);
    border-left-color: var(--tp-rose-500) !important;
    border-radius: 6px;
}

.tpsub-countdown {
    display: inline-block;
    margin-left: 8px;
    padding: 3px 8px;
    background: var(--tp-rose-100);
    color: var(--tp-rose-700);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

/* Briefing Card - Professional Redesign */
.tpsub-briefing-card {
    background: white;
    border: 1px solid var(--tp-slate-200);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tpsub-briefing-card .tpsub-card-header {
    background: linear-gradient(135deg, var(--tp-slate-700) 0%, var(--tp-slate-600) 100%);
    padding: 20px 24px;
    border-bottom: none;
}

.tpsub-briefing-card .tpsub-card-header h2 {
    color: white;
    margin: 0;
    padding: 0;
    border: none;
}

.tpsub-compulsory-badge {
    background: var(--tp-rose-600);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
}

.tpsub-briefing-notice {
    background: var(--tp-amber-50);
    border-left: 4px solid var(--tp-amber-500);
    color: var(--tp-amber-900);
}

/* Timeline Card - Professional Redesign */
.tpsub-dates-card {
    background: white;
    border: 1px solid var(--tp-slate-200);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
}

.tpsub-dates-card .tpsub-card-header {
    background: var(--tp-slate-50);
    padding: 16px 20px;
    border-bottom: 1px solid var(--tp-slate-200);
}

.tpsub-dates-card .tpsub-card-header .tpsub-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tpsub-dates-card .tpsub-card-header .tpsub-icon {
    font-size: 16px;
}

.tpsub-dates-card .tpsub-card-header h2 {
    color: var(--tp-slate-900);
    margin: 0;
    padding: 0;
    border: none;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.tpsub-dates-card .tpsub-timeline {
    padding: 16px;
}

.tpsub-timeline-date {
    background: white;
    border: 2px solid var(--tp-slate-200);
}

.tpsub-date-day {
    color: var(--tp-slate-900);
}

.tpsub-date-month {
    color: var(--tp-slate-500);
}

.tpsub-date-year {
    color: var(--tp-slate-400);
}

.tpsub-timeline-badge {
    padding: 4px 10px;
    font-size: 10px;
}

.tpsub-badge-publication {
    background: var(--tp-blue-100);
    color: var(--tp-blue-700);
}

.tpsub-badge-briefing {
    background: var(--tp-slate-100);
    color: var(--tp-slate-700);
}

.tpsub-badge-clarification {
    background: var(--tp-amber-100);
    color: var(--tp-amber-700);
}

.tpsub-badge-deadline {
    background: var(--tp-rose-100);
    color: var(--tp-rose-700);
}

.tpsub-badge-opening {
    background: var(--tp-emerald-100);
    color: var(--tp-emerald-700);
}

.tpsub-timeline-deadline .tpsub-timeline-date {
    background: var(--tp-rose-50);
    border-color: var(--tp-rose-200);
}

.tpsub-timeline-deadline .tpsub-date-day {
    color: var(--tp-rose-700);
}

.tpsub-timeline-deadline .tpsub-date-month {
    color: var(--tp-rose-600);
}

/* Sidebar Timeline - More Compact */
.tpsub-quick-sidebar .tpsub-timeline {
    padding: 12px;
}

.tpsub-quick-sidebar .tpsub-timeline-item {
    padding: 12px 0;
    gap: 12px;
}

.tpsub-quick-sidebar .tpsub-timeline-item:not(:last-child)::after {
    left: 28px;
    top: 60px;
}

.tpsub-quick-sidebar .tpsub-timeline-date {
    width: 56px;
    padding: 8px 4px;
}

.tpsub-quick-sidebar .tpsub-date-day {
    font-size: 20px;
}

.tpsub-quick-sidebar .tpsub-date-month {
    font-size: 10px;
    margin-top: 2px;
}

.tpsub-quick-sidebar .tpsub-date-year {
    font-size: 9px;
}

.tpsub-quick-sidebar .tpsub-timeline-content h3 {
    font-size: 13px;
    margin-bottom: 2px;
}

.tpsub-quick-sidebar .tpsub-timeline-content p {
    font-size: 11px;
}

.tpsub-quick-sidebar .tpsub-timeline-badge {
    padding: 3px 8px;
    font-size: 9px;
    margin-bottom: 6px;
}

/* Responsive Design - Perfect Mobile Layout */
@media (max-width: 1024px) {
    .tpsub-detail-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .tpsub-quick-sidebar {
        order: -1;
    }

    .tpsub-quick-panel {
        position: static;
    }

    .tpsub-info-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tpsub-detail-page {
        padding: 20px 16px 40px !important;
    }

    .tpsub-detail-header {
        padding: 20px;
    }

    .tpsub-detail-title {
        font-size: 22px;
    }

    .tpsub-header-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .tpsub-star-btn,
    .tpsub-send-email-btn,
    .tpsub-ai-workspace-btn,
    .tpsub-share-btn {
        padding: 12px 16px;
        font-size: 12px;
        justify-content: center;
    }

    .tpsub-info-panel,
    .tpsub-dates-panel,
    .tpsub-description-panel,
    .tpsub-briefing-card,
    .tpsub-dates-card {
        padding: 20px;
    }

    .tpsub-timeline-item {
        gap: 16px;
    }

    .tpsub-timeline-date {
        width: 64px;
    }
}

@media (max-width: 480px) {
    .tpsub-header-actions {
        grid-template-columns: 1fr;
    }

    .tpsub-countdown-large .days {
        font-size: 28px;
    }
}
