* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #8A2BE2 0%, #4B0082 50%, #0000FF 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.app-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.bangun-pilihan {
    flex: 1;
    min-width: 300px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.bangun-pilihan h2 {
    color: #6a11cb;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.bangun-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.bangun-item {
    appearance: none;
    font: inherit;
    width: 100%;
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: white;
    font-weight: 600;
}

.bangun-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.bangun-item.active {
    border-color: #27ae60;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.3);
    transform: translateY(-2px);
}

.bangun-item.active:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

.bangun-item h3 {
    font-size: 1.2rem;
    color: white;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.kalkulator {
    flex: 2;
    min-width: 300px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.kalkulator h2 {
    color: #6a11cb;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #6a11cb;
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
}

.input-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.input-field {
    display: flex;
    flex-direction: column;
}

.input-field label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.input-field input {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: white;
}

.input-field input:focus {
    outline: none;
    border-color: #6a11cb;
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
}

.btn-hitung {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(37, 117, 252, 0.3);
}

.btn-hitung:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 117, 252, 0.4);
}

.btn-hitung:active {
    transform: translateY(0);
}

.hasil-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #6a11cb;
}

.hasil-container h3 {
    color: #6a11cb;
    margin-bottom: 15px;
    text-align: center;
}

.hasil-nilai {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.hasil-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.hasil-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

.hasil-value {
    font-weight: bold;
    color: #6a11cb;
    font-size: 1.2rem;
}

.langkah-penyelesaian {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #27ae60;
}

.langkah-penyelesaian h3 {
    color: #27ae60;
    margin-bottom: 15px;
    text-align: center;
}

.langkah {
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 3px solid #6a11cb;
}

.langkah:last-child {
    margin-bottom: 0;
}

.langkah-nomor {
    font-weight: bold;
    color: #6a11cb;
    margin-bottom: 8px;
}

.rumus {
    font-family: 'Courier New', monospace;
    background: #e9ecef;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    border-left: 3px solid #6a11cb;
}

.ilustrasi {
    text-align: left;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.ilustrasi h3 {
    color: #6a11cb;
    margin-bottom: 15px;
    text-align: center;
}

.ilustrasi-bangun {
    text-align: left;
}

#definisi-bangun h4 {
    color: #6a11cb;
    margin-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

#definisi-bangun p {
    margin-bottom: 20px;
    line-height: 1.6;
}

.unsur-bangun {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
}

.unsur-bangun h5 {
    color: #27ae60;
    margin-bottom: 10px;
}

.unsur-bangun ul {
    list-style-type: disc;
    margin-left: 20px;
}

.unsur-bangun li {
    margin-bottom: 8px;
    line-height: 1.5;
}

footer {
    text-align: center;
    margin-top: 30px;
    color: white;
    opacity: 0.9;
    padding: 20px;
    font-size: 0.9rem;
}

/* Hapus semua CSS untuk bentuk 3D */
.shape-3d, .cube-3d, .cuboid-3d, .prism-3d, .pyramid-3d,
.bangun-icon, .face {
    display: none;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .app-container {
        gap: 15px;
    }
    
    .bangun-pilihan, .kalkulator {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .app-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .bangun-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    header h1 {
        font-size: 2rem;
        margin-bottom: 8px;
    }
    
    header p {
        font-size: 1.1rem;
    }
    
    .bangun-pilihan, .kalkulator {
        padding: 18px;
        min-width: unset;
    }
    
    .input-group {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .hasil-nilai {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .form-control, .input-field input {
        padding: 10px;
        font-size: 0.95rem;
    }
    
    .btn-hitung {
        padding: 14px;
        font-size: 1rem;
    }
    
    footer {
        margin-top: 20px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .bangun-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .bangun-pilihan, .kalkulator {
        padding: 15px;
        border-radius: 12px;
    }
    
    .bangun-item {
        padding: 15px;
        min-height: 70px;
    }
    
    .bangun-item h3 {
        font-size: 1.1rem;
    }
    
    .kalkulator h2, .bangun-pilihan h2 {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }
    
    .hasil-container, .langkah-penyelesaian {
        padding: 15px;
    }
    
    .langkah {
        padding: 12px;
    }
    
    .rumus {
        padding: 8px;
        font-size: 0.9rem;
    }
    
    .ilustrasi {
        padding: 12px;
        margin-top: 15px;
    }
    
    footer {
        font-size: 0.85rem;
        padding: 12px;
    }
}

@media (max-width: 360px) {
    header h1 {
        font-size: 1.6rem;
    }
    
    header p {
        font-size: 0.9rem;
    }
    
    .bangun-pilihan, .kalkulator {
        padding: 12px;
    }
    
    .bangun-item {
        padding: 12px;
    }
    
    .form-control, .input-field input {
        padding: 8px;
        font-size: 0.9rem;
    }
    
    .btn-hitung {
        padding: 12px;
        font-size: 0.95rem;
    }
}

/* Touch-friendly improvements for mobile */
@media (hover: none) and (pointer: coarse) {
    .bangun-item:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    
    .btn-hitung:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(37, 117, 252, 0.3);
    }
    
    .bangun-item:active, .btn-hitung:active {
        transform: scale(0.98);
    }
}

/* Improved focus states for accessibility */
.bangun-item:focus, .btn-hitung:focus, .form-control:focus, .input-field input:focus {
    outline: 2px solid #6a11cb;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* Smooth scrolling for better mobile experience */
html {
    scroll-behavior: smooth;
}

/* Prevent horizontal scrolling */
body {
    overflow-x: hidden;
}

/* ... (CSS yang sudah ada sebelumnya) ... */

/* ===== STYLE UNTUK SHARE BUTTONS ===== */
.share-container {
    margin-top: 20px;
    text-align: center;
    /* Hapus background dan border-radius */
    background: transparent;
    border-radius: 0;
    backdrop-filter: none;
    padding: 10px 0; /* Kurangi padding */
}

.share-text {
    color: white;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.share-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.share-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.3rem;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Perkuat shadow untuk kontras */
}

.share-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
}

.share-btn:active {
    transform: translateY(0);
}

/* Warna untuk masing-masing button */
.whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
}

.facebook {
    background: linear-gradient(135deg, #1877F2, #0D5AB9);
}

.twitter {
    background: linear-gradient(135deg, #1DA1F2, #0D8BD9);
}

.instagram {
    background: linear-gradient(135deg, #E4405F, #C13584);
}

.telegram {
    background: linear-gradient(135deg, #0088CC, #006699);
}

.link {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
}

/* Notification untuk copy link */
.copy-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(39, 174, 96, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.copy-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Responsive untuk share buttons */
@media (max-width: 768px) {
    .share-btn {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .share-buttons {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .share-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .share-buttons {
        gap: 8px;
    }
    
    .share-text {
        font-size: 1rem;
    }
    
    .share-container {
        padding: 8px 0;
    }
}

@media (max-width: 360px) {
    .share-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .share-buttons {
        gap: 6px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .share-btn:hover {
        transform: none;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }
    
    .share-btn:active {
        transform: scale(0.95);
    }
}

/* Accessibility improvements */
.share-btn:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}
/* ... (CSS sebelumnya) ... */

/* ===== PERBAIKAN RESPONSIVITAS ===== */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    
    .bangun-pilihan, .kalkulator {
        width: 100%;
    }
    
    .bangun-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .input-group {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .input-group {
        grid-template-columns: 1fr;
    }
    
    .hasil-nilai {
        grid-template-columns: 1fr;
    }
    
    .share-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    .share-buttons {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .bangun-list {
        grid-template-columns: 1fr;
    }
    
    .share-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .share-buttons {
        gap: 8px;
    }
    
    /* Perbaikan untuk teks yang terlalu panjang */
    .langkah-penyelesaian .rumus {
        font-size: 0.9rem;
        overflow-x: auto;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
}

/* Perbaikan khusus untuk layar sangat kecil */
@media (max-width: 360px) {
    .container {
        padding: 5px;
    }
    
    .share-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .share-buttons {
        gap: 6px;
    }
    
    /* Perbaikan overflow horizontal */
    body {
        overflow-x: hidden;
    }
    
    .kalkulator, .bangun-pilihan {
        padding: 12px 8px;
    }
}

/* Perbaikan untuk copy notification di mobile */
@media (max-width: 768px) {
    .copy-notification {
        bottom: 80px; /* Naikkan agar tidak tertutup keyboard */
        left: 20px;
        right: 20px;
        transform: translateX(0) translateY(100px);
        text-align: center;
    }
    
    .copy-notification.show {
        transform: translateX(0) translateY(0);
    }
}

/* Pastikan form tetap rapi di semua ukuran */
.input-field {
    min-width: 0; /* Mencegah overflow */
}

/* Perbaikan untuk hasil perhitungan yang panjang */
.hasil-value {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Touch target yang lebih besar untuk mobile */
@media (max-width: 768px) {
    .bangun-item {
        min-height: 70px;
        padding: 15px;
    }
    
    .btn-hitung {
        min-height: 48px;
        padding: 12px 20px;
    }
    
    select.form-control, 
    .input-field input {
        min-height: 44px; /* Touch target lebih besar */
    }
}

/* Perbaikan z-index untuk notification */
.copy-notification {
    z-index: 9999;
}

/* Perbaikan untuk teks yang overflow di hasil */
.hasil-item {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsivitas untuk ilustrasi */
@media (max-width: 768px) {
    .ilustrasi {
        font-size: 0.95rem;
    }
    
    .unsur-bangun ul {
        padding-left: 20px;
    }
}

/* Responsivitas untuk footer */
@media (max-width: 480px) {
    footer {
        font-size: 0.85rem;
        padding: 15px 10px;
    }
}
