/* Import Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

/* Reset dan Pengaturan Dasar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-image: url('img/ftsp.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: rgba(44, 62, 80, 0.9);
    color: #fff;
    padding: 1.5rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 5px solid #e74c3c;
}

#logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 1rem;
    perspective: 800px;
}

#logo {
    width: 70px;
    height: auto;
    transition: transform 0.4s ease-out;
}

#ftsp-text {
    font-weight: 700;
    font-size: 2.5rem;
    margin: 0;
    transition: transform 0.4s ease-out;
}

header h2 {
    font-weight: 600;
    font-size: 2rem;
}

header p {
    font-size: 1rem;
    max-width: 800px;
    margin: 0.5rem auto 0;
}


/* Card Style */
.card {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.card h2, .card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 10px;
}

/* Grid Layouts */
.grid-harga, .grid-dimensi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

/* Input Fields */
label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="number"], input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="number"]:focus, input[type="date"]:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
    outline: none;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 20px;
    background-color: #34495e;
    border-radius: 8px;
    overflow: hidden;
}

.tab-link {
    padding: 15px 20px;
    cursor: pointer;
    background-color: transparent;
    border: none;
    color: white;
    font-size: 1rem;
    transition: background-color 0.3s;
    flex-grow: 1;
}

.tab-link:hover {
    background-color: #4a6572;
}

.tab-link.active {
    background-color: #e74c3c;
    font-weight: bold;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Tombol Aksi */
#reset-button, #download-button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px; /* Tambah margin atas */
    margin-right: 10px;
    width: auto;
}

#reset-button {
    background-color: #95a5a6;
}

#reset-button:hover {
    background-color: #7f8c8d;
}

#download-button:hover {
    background-color: #c0392b;
}

/* Tabel Hasil */
#tabel-hasil {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#tabel-hasil th, #tabel-hasil td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#tabel-hasil thead {
    background-color: #34495e;
    color: white;
}

#tabel-hasil tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

#tabel-hasil tfoot {
    font-size: 1.2rem;
    color: #2c3e50;
}

#total-biaya {
    font-weight: 700;
    color: #e74c3c;
}

/* Chart & Summary */
.chart-container {
    position: relative;
    margin: auto;
    height: 40vh;
    width: 100%;
    margin-bottom: 30px;
}

#summary-emisi, #summary-pekerja {
    text-align: center;
    padding: 15px;
    background-color: #f4f7f9;
    border-radius: 8px;
    margin-top: 15px;
}
#summary-emisi p, #summary-pekerja p {
    margin: 5px 0;
    font-size: 1.1rem;
}
#summary-emisi strong, #summary-pekerja strong {
    color: #e74c3c;
}


/* Footer */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    background-color: #2c3e50;
    color: #fff;
}

/* =================================== */
/* ATURAN RESPONSIVE UNTUK LAYAR KECIL */
/* =================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    header {
        padding: 1rem;
    }

    #logo {
        width: 50px;
    }

    #ftsp-text {
        font-size: 1.8rem;
    }

    header h2 {
        font-size: 1.5rem;
    }

    header p {
        font-size: 0.9rem;
    }

    .card {
        padding: 15px;
    }
    
    .tabs {
        flex-direction: column;
    }

    .tab-link {
        font-size: 0.9rem;
        padding: 12px 15px;
    }

    /* Membuat Tabel menjadi Responsif */
    #tabel-hasil thead {
        display: none; /* Sembunyikan header tabel di layar kecil */
    }

    #tabel-hasil tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 5px;
        padding: 10px;
        box-shadow: 0 2px 3px rgba(0,0,0,0.05);
    }
    
    #tabel-hasil tfoot tr {
        border: none;
        box-shadow: none;
        padding: 0;
    }

    #tabel-hasil td {
        display: block;
        text-align: right; /* Pindahkan nilai ke kanan */
        font-size: 0.95rem;
        border-bottom: 1px dotted #ccc;
        padding: 8px 5px;
        position: relative;
    }

    #tabel-hasil td:last-child {
        border-bottom: none;
    }
    
    /* Membuat label dari data-attribute */
    #tabel-hasil td::before {
        content: attr(data-label); /* Ambil teks dari atribut data-label */
        position: absolute;
        left: 10px;
        font-weight: bold;
        text-align: left;
        white-space: nowrap;
        color: #333;
    }

    #tabel-hasil tfoot td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 1.1rem;
        padding: 10px 0;
    }

    #tabel-hasil tfoot td::before {
        position: static;
        font-weight: bold;
    }

    #reset-button, #download-button {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
        font-size: 0.9rem;
    }
}