/* General & Utility Styles */
:root {
    --primary: #F40009;
    --primary-dark: #D10007;
    --secondary: #11161E;
    --light: #FFFFFF;
    --dark: #000000;
    --gray: #F5F5F5;
    --dark-gray: #888888;
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;
    --info: #17A2B8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--secondary);
    color: var(--light);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Page & Layout */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    background-color: var(--secondary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.main-content {
    background-color: rgba(17, 22, 30, 0.8);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary);
}

.page-subtitle {
    font-size: 16px;
    color: var(--dark-gray);
    max-width: 700px;
    margin: 0 auto;
}

/* Header & Navigation */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

.logo-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.logo {
    height: 60px;
    margin-right: 15px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--light);
    text-transform: uppercase;
}

.nav {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.nav-link {
    color: var(--light);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link i {
    font-size: 16px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background-color: var(--primary);
    color: var(--light);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    color: var(--dark-gray);
    font-size: 14px;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--dark-gray);
    transition: all 0.3s ease;
}

.contact-item i {
    color: var(--primary);
    font-size: 18px;
}

.contact-item:hover {
    color: var(--light);
    transform: translateX(5px);
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.social-icon {
    color: var(--dark-gray);
    font-size: 16px;
    transition: all 0.3s ease;
}

.social-icon:hover {
    color: var(--primary);
}

/* Buttons */
.download-btn, .apply-btn, .tender-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 8px;
}

.download-btn {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.download-btn:hover {
    background-color: var(--success);
    color: var(--light);
}

.apply-btn {
    background-color: rgba(244, 0, 9, 0.1);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.apply-btn:hover {
    background-color: var(--primary);
    color: var(--light);
}

.view-btn {
    background-color: rgba(244, 0, 9, 0.1);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.view-btn:hover {
    background-color: var(--primary);
    color: var(--light);
}

/* Progress Bar Styles - MISSING FROM ORIGINAL */
.progress-container {
    margin: 40px 0;
    text-align: center;
}

.progress-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--light);
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.progress-visual {
    max-width: 600px;
    margin: 0 auto;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 30px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    width: 35%;
    border-radius: 10px;
    position: relative;
    animation: progressPulse 2s ease-in-out infinite;
}

.wave-animation {
    position: relative;
    overflow: hidden;
}

.wave-animation::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: wave 2s linear infinite;
}

.progress-icons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.progress-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.progress-icon i {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--dark-gray);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.progress-icon span {
    font-size: 12px;
    color: var(--dark-gray);
    font-weight: 500;
    transition: all 0.3s ease;
}

.progress-icon.active i {
    background-color: var(--primary);
    color: var(--light);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(244, 0, 9, 0.3);
}

.progress-icon.active span {
    color: var(--primary);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

@keyframes progressPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes wave {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes hoverGrow {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.05);
    }
}

.fade-in {
    animation: fadeIn 1s ease-out;
}

.slide-in {
    animation: slideIn 0.8s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

.rotate {
    animation: rotate 2s linear infinite;
}

.hover-grow:hover {
    animation: hoverGrow 0.3s ease-out forwards;
}

/* Tenders Page Specific Styles */
.tenders-container {
    max-width: 90%;
    margin: 0 auto;
}

.division-container {
    margin-bottom: 40px;
}

.division-title {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--light);
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    padding-bottom: 5px;
    width: 100%;
}

.tenders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
    
    /* This is the key to making the rows expand to fit content */
    grid-auto-rows: minmax(min-content, max-content);
}

.tender-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    
    /* These are the key changes to make the box adjustable */
    min-height: auto; /* Allow the height to be fully dynamic */
    display: flex;
    flex-direction: column;
}

.tender-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: var(--primary);
}

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

.tender-id {
    font-weight: 500;
    color: var(--primary);
}

.tender-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
    text-transform: uppercase;
}

.tender-status.open {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.tender-status.closed {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.tender-status.awarded {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--info);
    border: 1px solid var(--info);
}

.tender-title {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
    
    /* This is essential to make the title expand and push content down */
    flex-grow: 1; 
}

.tender-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--dark-gray);
}

.meta-item i {
    font-size: 14px;
}

.tender-actions {
    display: flex;
    gap: 10px;
    
    /* Pushes the buttons to the bottom of the flex container */
    margin-top: auto; 
}

.tender-btn {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Other Page Styles (Vacancies, Under Construction, etc.) */
.construction-message {
    text-align: center;
    padding: 40px 0;
}

.construction-icon {
    font-size: 80px;
    color: var(--primary);
    margin-bottom: 20px;
}

.construction-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary);
    text-transform: uppercase;
}

.construction-text {
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto 30px;
    line-height: 1.6;
}

.countdown-container {
    margin: 40px 0;
}

.countdown-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--light);
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-number {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
    background-color: rgba(244, 0, 9, 0.1);
    padding: 10px 20px;
    border-radius: 10px;
    min-width: 100px;
    text-align: center;
}

.countdown-label {
    font-size: 14px;
    margin-top: 5px;
    color: var(--dark-gray);
}

.quick-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.link-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    width: 280px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.link-card:hover {
    background-color: rgba(244, 0, 9, 0.2);
    border-color: var(--primary);
    transform: translateY(-5px);
}

.link-icon {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 15px;
}

.link-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.link-card p {
    font-size: 14px;
    color: var(--dark-gray);
}

.search-filter {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90%;
    margin: 0 auto 30px;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--light);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(244, 0, 9, 0.2);
}

.filter-select {
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--light);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(244, 0, 9, 0.2);
}

.vacancies-container {
    max-width: 100%;
    margin: 0 auto;
}

.vacancies-table-container {
    overflow-x: auto;
    width: 90%;
    margin: 0 auto;
}

.vacancies-table, .tender-table {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 40px;
    border-collapse: collapse;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    table-layout: fixed;
}

.vacancies-table th, .tender-table th {
    background-color: var(--primary);
    color: var(--light);
    padding: 15px;
    text-align: center;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.vacancies-table td, .tender-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.vacancies-table tr:last-child td {
    border-bottom: none;
}

.vacancies-table tr:hover, .tender-table tr:hover {
    background-color: rgba(244, 0, 9, 0.1);
}

.table-heading {
    text-align: center;
    font-size: 20px;
    margin-top: 40px;
    margin-bottom: 25px;
    font-weight: 600;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .logo-text {
        font-size: 20px;
    }

    .construction-title {
        font-size: 32px;
    }

    .countdown {
        flex-wrap: wrap;
    }

    .countdown-number {
        font-size: 36px;
        min-width: 80px;
    }

    .quick-links {
        flex-direction: column;
        align-items: center;
    }

    .link-card {
        width: 100%;
    }

    .search-filter {
        flex-direction: column;
    }

    .search-input, .filter-select {
        width: 100%;
    }

    .vacancies-table-container,
    .tenders-container {
        width: 100%;
        padding: 0 10px;
    }

    .contact-info {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        text-align: center;
    }

    .progress-icons {
        flex-wrap: wrap;
        gap: 20px;
        justify-content: center;
    }

    .progress-icon i {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .logo-container {
        flex-direction: column;
        text-align: center;
    }

    .logo {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .nav {
        flex-direction: column;
        gap: 10px;
    }

    .countdown-item {
        width: calc(50% - 10px);
    }

    .vacancies-table td, .vacancies-table th {
        padding: 10px 5px;
        font-size: 13px;
    }

    .tender-filters {
        flex-direction: column;
        align-items: center;
    }

    .progress-visual {
        max-width: 100%;
    }

    .progress-icons {
        gap: 15px;
    }

    .progress-icon i {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .progress-icon span {
        font-size: 11px;
    }
}