/* ==========================================
   Tenders Page Styles
   Based on Figma Design
   ========================================== */

/* Hero Section */
.tenders-hero {
    position: relative;
    background-color: #3D5AA8;
    padding: 80px 112px;
    overflow: hidden;
}

.tenders-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at -4325% -4325%, rgba(29, 37, 48, 1) 1%, rgba(29, 37, 48, 0) 1%);
    opacity: 0.05;
    pointer-events: none;
}

.tenders-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tenders-hero-content h1 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 48px;
    line-height: 1em;
    letter-spacing: -0.025em;
    color: #FFFFFF;
    max-width: 1216px;
}

.tenders-hero-content p {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 20px;
    line-height: 1.4em;
    color: rgba(255, 255, 255, 0.8);
    max-width: 768px;
}

/* Main Content */
.tenders-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 64px;
    padding: 0 0 64px;
    background-color: #F9FAFB;
}

.tenders-container {
    width: 100%;
    max-width: 1440px;
    padding: 0 var(--spacing-3xl);
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-top: 64px;
}

/* Section Header */
.tenders-section-header {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 16px;
}

.tenders-section-header h2 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 24px;
    line-height: 1.302em;
    text-transform: uppercase;
    color: #1D2530;
}

/* Tabs Wrapper */
.tenders-tabs-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

/* Tab List */
.tenders-tablist {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 6px;
    height: 64px;
    background-color: rgba(29, 37, 48, 0.03);
    border-radius: 14px;
}

.tenders-tab {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 6px 24px;
    height: 100%;
    background-color: transparent;
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 1.302em;
    letter-spacing: -0.02em;
    color: #67717E;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tenders-tab.active {
    background-color: #FFFFFF;
    box-shadow: 0px 0.5px 2px 0px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    color: #1D2530;
    min-width: 213px;
}

.tenders-badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 2px 8px;
    border: 1px solid rgba(0, 0, 0, 0);
    border-radius: 9999px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.302em;
    opacity: 0.7;
}

.tenders-badge-active {
    background-color: #D1FAE5;
    color: #047857;
}

.tenders-badge-closed {
    background-color: rgba(103, 113, 126, 0.12);
    color: #67717E;
}

/* Layout Toggle Buttons */
.layout-toggle {
    display: flex;
    gap: 4px;
    background-color: #FFFFFF;
    border: 1px solid #DCE0E5;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0px 1px 2px 0px rgba(29, 37, 48, 0.03);
}

.layout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: none;
    border-radius: 6px;
    color: #67717E;
    cursor: pointer;
    transition: all 0.3s ease;
}

.layout-btn:hover {
    background-color: #F9FAFB;
    color: #1D2530;
}

.layout-btn.active {
    background-color: #3D5AA8;
    color: #FFFFFF;
}

.layout-btn svg {
    width: 16px;
    height: 16px;
}

/* Tab Panels */
.tenders-tabpanels {
    display: flex;
    flex-direction: column;
}

.tenders-tabpanel {
    display: none;
    padding-top: 16px;
}

.tenders-tabpanel.active {
    display: block;
}

/* Tender Grid */
.tenders-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Tender Card */
.tender-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background-color: #FFFFFF;
    border: 1px solid #DCE0E5;
    border-radius: 6px;
    box-shadow: 0px 1px 2px 0px rgba(29, 37, 48, 0.03);
    transition: all 0.3s ease;
}

.tender-card:hover {
    box-shadow: 0px 4px 12px 0px rgba(29, 37, 48, 0.1);
    transform: translateY(-2px);
}

.tender-lot {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 1.333em;
    color: #67717E;
    margin: 0;
}

.tender-card h3 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 18px;
    line-height: 1.25em;
    letter-spacing: -0.025em;
    color: #1D2530;
    margin: 0;
}

.tender-date {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 4px 0 8px;
}

.tender-date span {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.429em;
    color: #67717E;
}

.tender-download {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background-color: #F9FAFB;
    border: 1px solid #DCE0E5;
    border-radius: 4px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.429em;
    text-align: center;
    color: #1D2530;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tender-download:hover {
    background-color: #3D5AA8;
    color: #FFFFFF;
}

.tender-download:hover svg path {
    stroke: #FFFFFF;
}

.tender-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 4px;
}

.tender-download-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: #F9FAFB;
    border: 1px solid #DCE0E5;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.tender-download-icon:hover {
    background-color: #3D5AA8;
}

.tender-download-icon:hover svg path {
    stroke: #FFFFFF;
}

/* Tenders Table */
.tenders-table-wrapper {
    width: 100%;
    overflow-x: auto;
    background-color: #FFFFFF;
    border: 1px solid #DCE0E5;
    border-radius: 6px;
    box-shadow: 0px 1px 2px 0px rgba(29, 37, 48, 0.03);
}

.tenders-table {
    width: 100%;
    border-collapse: collapse;
}

.tenders-table thead {
    background-color: #F9FAFB;
    border-bottom: 2px solid #DCE0E5;
}

.tenders-table th {
    padding: 16px 20px;
    text-align: left;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.429em;
    letter-spacing: -0.01em;
    color: #6B7280;
    white-space: nowrap;
}

.tenders-table th:first-child {
    width: 60px;
}

.tenders-table th:nth-child(3) {
    width: 120px;
}

.tenders-table th:nth-child(4) {
    width: 130px;
}

.tenders-table th:nth-child(5) {
    width: 140px;
}

.tenders-table th:last-child {
    width: 100px;
    text-align: center;
}

.tenders-table tbody tr {
    border-bottom: 1px solid #E6EBF0;
    transition: background-color 0.2s ease;
}

.tenders-table tbody tr:last-child {
    border-bottom: none;
}

.tenders-table tbody tr:hover {
    background-color: #F9FAFB;
}

.tenders-table td {
    padding: 16px 20px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.429em;
    color: #1D2530;
}

.tenders-table td:first-child {
    text-align: center;
    color: #6B7280;
}

.tenders-table td:last-child {
    text-align: center;
}

.tender-lot-number {
    font-weight: 500;
    color: #67717E;
}

.tender-lot-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    background-color: #fff;
    border: 1px solid #DCE0E5;
    border-radius: 9999px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    color: #67717E;
    white-space: nowrap;
}

.tender-title-cell {
    font-weight: 500;
    max-width: 400px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 1.333em;
    white-space: nowrap;
}

.status-badge.status-active {
    background-color: #DBEAFE;
    color: #1D4ED8;
}

.status-badge.status-awarded {
    background-color: #D1FAE5;
    color: #047857;
}

.status-badge.status-cancelled {
    background-color: #FEE2E2;
    color: #DC2626;
}

.status-badge.status-pending {
    background-color: #FEF3C7;
    color: #D97706;
}

.table-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    background-color: transparent;
    border: 1px solid #1D25301A;
    border-radius: 4px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #1D2530;
	line-height: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.table-download-btn:hover {
    background-color: #F3F4F6;
}

.table-download-btn span {
    line-height: 1;
}

/* Important Notice */
.tenders-notice {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    background-color: rgba(19, 56, 108, 0.05);
    border: 1px solid rgba(19, 56, 108, 0.1);
    border-radius: 12px;
}

.tenders-notice h4 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.5em;
    letter-spacing: -0.025em;
    color: #1D2530;
    margin: 0;
}

.tenders-notice p {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.429em;
    color: #67717E;
    margin: 0;
}

.tenders-notice a {
    color: #3D5AA8;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.tenders-notice a:hover {
    color: #1D2530;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .tenders-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .tenders-hero {
        padding: 60px 40px;
    }

    .tenders-hero-content h1 {
        font-size: 36px;
    }

    .tenders-hero-content p {
        font-size: 18px;
    }

    .tenders-container {
        padding: 0 20px;
    }

    .tenders-grid {
        grid-template-columns: 1fr;
    }

    .tenders-tabs-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .layout-toggle {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .tenders-hero {
        padding: 40px 20px;
    }

    .tenders-hero-content h1 {
        font-size: 28px;
        line-height: 1.2em;
    }

    .tenders-hero-content p {
        font-size: 16px;
    }

    .tenders-section-header h2 {
        font-size: 20px;
    }

    .tenders-tablist {
        width: 100%;
        height: auto;
        padding: 4px;
    }

    .tenders-tab {
        flex: 1;
        padding: 8px 12px;
        font-size: 14px;
        gap: 8px;
    }

    .tenders-tab.active {
        min-width: auto;
    }

    .tenders-badge {
        font-size: 12px;
        padding: 2px 6px;
    }

    .layout-toggle {
        padding: 3px;
    }

    .layout-btn {
        width: 36px;
        height: 36px;
    }

    .layout-btn svg {
        width: 14px;
        height: 14px;
    }

    .tender-card {
        padding: 16px;
    }

    .tender-card h3 {
        font-size: 16px;
    }

    .tenders-table-wrapper {
        overflow-x: scroll;
    }

    .tenders-table {
        min-width: 600px;
    }

    .tenders-table th,
    .tenders-table td {
        padding: 12px 16px;
        font-size: 13px;
    }

    .tenders-notice {
        padding: 16px;
    }

    .tenders-notice h4 {
        font-size: 14px;
    }

    .tenders-notice p {
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .tenders-hero {
        padding: 32px 16px;
    }

    .tenders-hero-content h1 {
        font-size: 24px;
    }

    .tenders-hero-content p {
        font-size: 14px;
    }

    .tenders-container {
        padding: 0 16px;
        margin-top: 32px;
    }

    .tenders-section-header h2 {
        font-size: 18px;
    }

    .tenders-tab {
        font-size: 12px;
        padding: 6px 8px;
    }

    .tender-card h3 {
        font-size: 15px;
    }

    .tender-date span {
        font-size: 12px;
    }

    .tender-download {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* Print Styles */
@media print {
    .tenders-hero {
        background-color: #FFFFFF;
        color: #1D2530;
    }

    .tenders-hero-content h1,
    .tenders-hero-content p {
        color: #1D2530;
    }

    .tenders-tablist,
    .tenders-border {
        display: none;
    }

    .tenders-tabpanel {
        display: block !important;
        page-break-inside: avoid;
    }

    .tender-card,
    .tenders-table-wrapper {
        break-inside: avoid;
    }

    .tender-download,
    .table-download-btn {
        display: none;
    }
}

/* Animations */
.tender-card {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Add stagger delay to grid items */
.tender-card:nth-child(1) { animation-delay: 0.1s; }
.tender-card:nth-child(2) { animation-delay: 0.2s; }
.tender-card:nth-child(3) { animation-delay: 0.3s; }
.tender-card:nth-child(4) { animation-delay: 0.4s; }
.tender-card:nth-child(5) { animation-delay: 0.5s; }
.tender-card:nth-child(6) { animation-delay: 0.6s; }
.tender-card:nth-child(7) { animation-delay: 0.7s; }
