:root {
    --primary: #7f528f;
    --primary-dark: #5d3a6a;
    --primary-light: #9f76af;
    --secondary: #f8f1fa;
    --text: #333;
    --light: #f5f5f5;
    --white: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: var(--light);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

header {
    background-color: #9f76af;
    color: var(--white);
    padding: 25px 0;
    text-align: center;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(127, 82, 143, 0.2);
    
}

h1 {
    margin: 0;
    font-size: 2rem;
}


.controls {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.controls input {
    flex: 1;
    min-width: 50px;
    padding: 12px 15px;
    border: 2px solid var(--primary-light);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.controls input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(127, 82, 143, 0.2);
}

.controls button {
    padding: 12px 20px;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.controls button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.ekskul-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.ekskul-card {
    background-color: #9f76af;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.ekskul-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: var(--primary);
    transition: height 0.3s ease;
    z-index: -1;
}

.ekskul-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.ekskul-card:hover::before {
    height: 100%;
}

.ekskul-card:hover h3,
.ekskul-card:hover p {
    color: white;
}

.ekskul-card img {
    width: 100%;
    height: 160px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.ekskul-card:hover img {
    transform: scale(1.05);
}

.ekskul-card h3 {
    color: white;
    margin: 0 0 10px;
    font-size: 1.3rem;
    transition: color 0.3s ease;
}

.ekskul-card p {
    margin: 0;
    color: white;
    transition: color 0.3s ease;
}

.ekskul-detail {
    background-color: #9f76af;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-top: 40px;
    display: none;
    animation: fadeIn 0.5s ease-out forwards;
    border: 1px solid rgba(127, 82, 143, 0.1);
}

.back-button {
    position: fixed;
    bottom: 20px; /* Jarak dari bawah */
    left: 20px; /* Jarak dari kiri */
    z-index: 1000; /* Pastikan tombol di atas konten lainnya */
}

.btn-back {
    text-decoration: none;
    color: #fff;
    background-color: #543572;
    padding: 10px 15px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-style: Times;
    transition: background-color 0.3s;
    min-width: 160px;
}

.btn-back:hover {
    background-color: #432a5a;
}

.arrow-icon {
    width: 30px;
    height: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-header {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 25px;
}

.detail-header img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border-radius: 10px;
    align-self: center;
    background-color: #9f76af;
    padding: 10px;
}

.detail-content h2 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.detail-content p {
    line-height: 1.7;
    color: white;
}

.documentation {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.documentation img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.documentation img:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.close-button {
    display: block;
    margin: 25px auto 0;
    padding: 12px 25px;
    background-color: #7f528f;
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.close-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

@media (max-width: 480px) {
    .detail-header {
        flex-direction: column;
    }
    
    .ekskul-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }
    
    header {
        padding: 20px 0;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .controls input,
    .controls button {
        width: 100%;
    }
    
    .ekskul-detail {
        padding: 20px;
    }
    
    .documentation {
        grid-template-columns: 1fr;
}
}
/* CSS untuk Tombol Scroll-to-Top */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  z-index: 1000;
}

.scroll-to-top:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.scroll-to-top.show {
  display: flex;
}

/* Animasi untuk scroll smooth */
html {
  scroll-behavior: smooth;
}