/* style.css - basic styling for the telecom search website */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f6fa;
    color: #2d3e50;
}

.site-header {
    background-color: #002f6c;
    color: #fff;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.site-header h1 {
    margin: 0;
    font-size: 28px;
    letter-spacing: 0.5px;
}

.nav-links a {
    margin-left: 18px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    text-decoration: underline;
    color: #a9d0ff;
}

/* Toggle button for mobile navigation (hidden on desktop) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    padding: 4px 6px;
}

.nav-links {
    display: flex;
    align-items: center;
}

/* section containers across pages */
.search-section,
.login-section,
.form-section,
.admin-section,
.about-section,
.info-section {
    padding: 24px;
    background-color: #ffffff;
    margin: 24px auto;
    max-width: 960px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.info-section h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 24px;
    color: #003a82;
}
.info-section p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #444;
}

/* Login box with image and form side by side */
.login-box {
    display: flex;
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-width: 760px;
    margin: 0 auto;
}

.login-image {
    flex: 1;
    min-width: 280px;
    background-color: #f0f5ff;
}

.login-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.login-form-wrapper {
    flex: 1;
    padding: 36px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form-wrapper h2 {
    margin-top: 0;
    margin-bottom: 18px;
    color: #003a82;
    font-size: 24px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-form label {
    font-weight: 500;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    padding: 12px;
    border: 1px solid #ccd4e1;
    border-radius: 6px;
    font-size: 15px;
}

.login-form button {
    padding: 12px 22px;
    background-color: #005fb8;
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    margin-top: 14px;
    width: 100%;
}

.login-form button:hover {
    background-color: #0074d9;
}

.search-form {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
}

.search-form input[type="text"] {
    flex: 1;
}

.search-form button {
    flex-shrink: 0;
}

.search-form input[type="text"],
.form-section input[type="text"],
.form-section input[type="file"],
.form-section textarea {
    padding: 10px;
    border: 1px solid #ccd4e1;
    border-radius: 6px;
    font-size: 14px;
}

.search-form button,
.form-section button {
    padding: 10px 18px;
    background-color: #005fb8;
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
}

.search-form button:hover,
.form-section button:hover {
    background-color: #0074d9;
}

/* =================================
   Search Results Styles
   ================================= */
.results-section {
    background-color: transparent; /* Hapus background putih di container utama */
    box-shadow: none; /* Hapus bayangan di container utama */
    padding-top: 0;
}

.results-section h2 {
    font-size: 24px;
    color: #003a82;
    margin-bottom: 20px;
    padding: 0 24px; /* Tambahkan padding agar sejajar */
}

.results-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px; /* Jarak antar kartu hasil pencarian */
}

/* Ini adalah style utama untuk kartu hasil pencarian */
.result-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    background-color: #ffffff; /* Setiap item punya background sendiri */
    border-radius: 8px;
    border: 1px solid #e6edf5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Efek hover saat mouse diarahkan ke kartu */
.result-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(45,62,80,0.1);
}

.result-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0; /* Mencegah gambar menyusut */
}

.result-info {
    flex-grow: 1;
}

.result-info h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #003a82;
}

.result-info p {
    margin: 0;
    line-height: 1.6;
    color: #555;
}

.members-list li.member-item a.member-link {
    display: flex;
    align-items: flex-start;
    width: 100%;
    text-decoration: none;
    color: inherit;
    padding: 0;
    margin: 0;
}

.members-list li.member-item a.member-link:hover {
    background-color: #f5faff;
}

/* Style untuk Bagian Guru Pembimbing */
.teacher-section {
    text-align: center;
    padding: 40px 20px;
    background-color: #f9f9f9;
}

.teacher-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.teacher-profile {
    display: inline-block;
    margin-top: 20px;
}

.teacher-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.teacher-info h3 {
    margin: 15px 0 5px 0;
    font-size: 1.5em;
    color: #333;
}

.teacher-info p {
    margin: 0;
    font-size: 1.1em;
    color: #666;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.admin-table th,
.admin-table td {
    border: 1px solid #ddd;
    padding: 8px;
    vertical-align: middle;
}

.admin-table th {
    background-color: #003a82;
    color: #ffffff;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
}

.admin-table tr:nth-child(even) {
    background-color: #f6f8fc;
}
.admin-table tr:nth-child(odd) {
    background-color: #ffffff;
}
.admin-table tr:hover {
    background-color: #eef4fc;
}

.thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.result-image,
.member-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    margin-right: 15px;
    border-radius: 4px;
}

.result-info h3,
.member-info h3 {
    margin: 0;
    font-size: 18px;
    color: #004d99;
}

.result-info p,
.member-info p {
    margin-top: 5px;
    line-height: 1.5;
}

.info-message {
    background-color: #e0f7fa;
    border: 1px solid #81d4fa;
    color: #01579b;
    padding: 8px 12px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.error-message {
    background-color: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
    padding: 8px 12px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.site-footer {
    background-color: #004d99;
    color: #fff;
    text-align: center;
    padding: 10px 0;
}

.site-footer p {
    margin: 0;
    font-size: 14px;
}

/* Hero section for landing page */
.hero-section {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
    margin-bottom: 20px;
}

.hero-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 20px 30px;
    border-radius: 8px;
}

.hero-content h2 {
    font-size: 36px;
    margin: 0 0 10px;
}

.hero-content p {
    font-size: 18px;
    margin: 0;
}

/* Featured section showing selected devices */
.featured-section {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.featured-section h2 {
    color: #004d99;
    margin-top: 0;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.featured-card {
    background-color: #f5faff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
}

.featured-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.featured-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.featured-card .card-content {
    padding: 12px 15px;
}

.featured-card h3 {
    margin: 0 0 6px;
    font-size: 20px;
    color: #004d99;
}

.featured-card p {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.4;
}

/* Catalog grid styling */
.catalog-section {
    max-width: 960px;
    margin: 24px auto;
    padding: 0;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.catalog-card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.catalog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.catalog-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.catalog-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.catalog-info {
    padding: 14px 16px;
}

.catalog-info h3 {
    margin: 0 0 6px;
    font-size: 18px;
    color: #003a82;
}

.catalog-info p {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

/* Product detail page */
.product-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.product-image {
    width: 100%;
    max-width: 480px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.product-info {
    max-width: 720px;
    text-align: left;
    line-height: 1.6;
}

.product-info h2 {
    margin-top: 0;
    color: #003a82;
}

.back-link {
    display: inline-block;
    margin-top: 16px;
    color: #005fb8;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
    color: #0074d9;
}

/* =================================
   Admin Form Styles
   ================================= */
.admin-form {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-form div {
    margin-bottom: 15px;
}

.admin-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.admin-form input[type="text"],
.admin-form input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Important for padding and width */
}

.admin-form button[type="submit"] {
    width: 100%;
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.admin-form button[type="submit"]:hover {
    background-color: #0056b3;
}

.error-messages {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 20px;
}


/* Responsive adjustments for mobile devices */
@media (max-width: 991.98px) {
    /* Stack header elements and show menu toggle on mobile */
    .site-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 20px;
        position: relative;
    }
    .site-header h1 {
        font-size: 20px;
        margin-bottom: 8px;
    }
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 14px;
        right: 20px;
        z-index: 10;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 64px;
        left: 0;
        width: 260px;
        height: calc(100vh - 64px);
        background-color: #003a82;
        padding: 12px 16px;
        box-shadow: 2px 0 6px rgba(0,0,0,0.2);
        z-index: 999;
    }
    .nav-links.open {
        display: flex;
    }
    .nav-links a {
        margin: 0;
        padding: 10px 20px;
        color: #ffffff;
        border-bottom: 1px solid rgba(255,255,255,0.15);
    }
    .nav-links a:last-child {
        border-bottom: none;
    }
    .hero-section {
        height: 250px;
    }
    .hero-content h2 {
        font-size: 24px;
    }
    .hero-content p {
        font-size: 14px;
    }
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
    .search-form input[type="text"] {
        margin-bottom: 8px;
        width: 100%;
    }
    .featured-grid,
    .catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .members-list li.member-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .members-list .member-photo,
    .members-list .result-image {
        margin-right: 0;
        margin-bottom: 8px;
    }
    .product-detail {
        flex-direction: column;
        align-items: center;
    }
    .product-image {
        max-width: 100%;
    }
    .admin-table {
        font-size: 12px;
    }
}

/* Desktop layout: hide hamburger and ensure nav horizontal */
@media (min-width: 992px) {
    .menu-toggle {
        display: none !important;
        pointer-events: none;
    }
    .nav-links {
        display: flex !important;
        position: static !important;
        flex-direction: row;
        width: auto;
        height: auto;
        box-shadow: none;
        background-color: transparent;
        gap: 18px;
    }
    .nav-links a {
        padding: 0;
        color: #ffffff;
        border-bottom: none;
        background: none;
    }
}