/* General Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.5;
    color: #333;
    background-color: #f9f9f9;
}

/* Utility Classes */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.section-padding {
    padding: 40px 0;
}

.text-center {
    text-align: center;
}

.bg-light {
    background-color: #f4f4f4;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: background-color 0.3s, transform 0.2s;
    touch-action: manipulation;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #28a745;
    color: #fff;
    border: none;
}

.btn-secondary:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

/* Header */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
}

.logo-link {
    text-decoration: none;
}

.logo-text {
    font-size: 20px;
    color: #007bff;
}

.menu-toggle {
    display: block;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

.main-navigation {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.main-navigation.active {
    display: flex;
}

.main-navigation a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 10px 15px;
    transition: background-color 0.3s;
}

.main-navigation a:hover {
    background-color: #f4f4f4;
}

.main-navigation .login-link,
.main-navigation .username-link {
    color: #007bff;
    font-weight: 600;
}

.main-navigation .login-link:hover,
.main-navigation .username-link:hover {
    background-color: #e6f0fa;
    color: #0056b3;
}

/* Hero Section */
#hero {
    position: relative;
    background: url('../images/hero-bg.jpg') no-repeat center center/cover;
    color: #fff;
    min-height: 300px;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;
}

.hero-content h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

.hero-content p {
    font-size: 14px;
    margin-bottom: 20px;
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

/* Free Tests Section */
#free-tests h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

#free-tests h3 {
    font-size: 18px;
    margin: 20px 0 15px;
}

.category-box {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.category-box.profession {
    background-color: #e6f0fa;
}

.category-box.personal {
    background-color: #e8f5e9;
}

.test-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.test-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s;
}

.test-card:hover {
    transform: translateY(-3px);
}

.test-image {
    height: 150px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.test-image-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 8px;
    border-radius: 4px;
    display: none;
}

.test-image:empty+.test-image-placeholder {
    display: block;
}

.test-card h3 {
    font-size: 16px;
    margin: 10px;
    text-align: center;
    /* Memusatkan judul tes */
}

.test-card p {
    font-size: 14px;
    margin: 0 10px 15px;
    color: #666;
}

.test-card .btn {
    display: block;
    margin: 0 10px 10px;
    text-align: center;
}

/* Categories Section */
#categories h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

.category-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.category-link {
    text-decoration: none;
    color: inherit;
    display: block;
    flex: 1 1 100%;
}

.category-link:hover .category-card {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.category-link:active .category-card {
    transform: scale(0.98);
}

.category-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.category-image {
    height: 150px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.category-image-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 8px;
    border-radius: 4px;
    display: none;
}

.category-image:empty+.category-image-placeholder {
    display: block;
}

.category-card h3 {
    font-size: 16px;
    margin: 10px;
}

.category-card p {
    font-size: 14px;
    margin: 0 10px 15px;
    color: #666;
    flex-grow: 1;
}

/* Suggestions Section */
#suggestions h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

#suggestions p {
    font-size: 14px;
    margin-bottom: 20px;
}

/* Contact Section */
#contact {
    position: relative;
    background: url('../images/form-bg.jpg') no-repeat center center/cover;
}

#contact .container {
    position: relative;
    z-index: 2;
}

.contact-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

#contact h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #fff;
}

#contact p {
    font-size: 14px;
    margin-bottom: 20px;
    color: #fff;
}

/* Form Styles */
form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

form input,
form textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    width: 100%;
}

form textarea {
    min-height: 120px;
    resize: vertical;
}

form button {
    align-self: flex-start;
}

.form-message {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 500;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

#suggestions .form-message {
    color: #333;
}

#contact .form-message {
    color: #fff;
    background-color: rgba(0, 0, 0, 0.7);
}

.form-message.success {
    color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.form-message.error {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

/* Footer */
footer {
    background-color: #333;
    color: #fff;
    padding: 15px 0;
}

footer .container {
    text-align: center;
}

.social-media {
    margin-bottom: 10px;
}

.social-media a {
    color: #fff;
    margin: 0 8px;
    font-size: 20px;
    transition: color 0.3s;
}

.social-media a:hover {
    color: #007bff;
}

footer p {
    font-size: 12px;
}

/* Desktop Styles */
@media (min-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .section-padding {
        padding: 60px 0;
    }

    .menu-toggle {
        display: none;
    }

    .main-navigation {
        display: flex;
        flex-direction: row;
        position: static;
        width: auto;
        background: none;
        box-shadow: none;
        gap: 20px;
        align-items: center;
    }

    .main-navigation a {
        padding: 0;
    }

    .main-navigation .login-link,
    .main-navigation .username-link {
        margin-left: auto;
    }

    .hero-content h2 {
        font-size: 32px;
    }

    .hero-content p {
        font-size: 16px;
    }

    .hero-buttons {
        flex-direction: row;
        gap: 20px;
        justify-content: center;
    }

    .test-grid,
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .test-image,
    .category-image {
        height: 180px;
    }

    .test-card h3,
    .category-card h3 {
        font-size: 18px;
    }

    .test-card p,
    .category-card p {
        font-size: 15px;
    }

    #free-tests h2,
    #categories h2,
    #suggestions h2,
    #contact h2 {
        font-size: 28px;
    }

    #about p,
    #suggestions p,
    #contact p {
        font-size: 16px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 16px;
    }

    form input,
    form textarea {
        font-size: 16px;
    }

    .category-box {
        padding: 30px;
    }

    .category-grid {
        flex-wrap: nowrap;
    }

    .category-link {
        flex: 1 1 0;
    }
}

@media (min-width: 1200px) {
    .hero-content h2 {
        font-size: 36px;
    }

    .hero-content p {
        font-size: 18px;
    }

    .test-grid,
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .test-image,
    .category-image {
        height: 200px;
    }
}