@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #415B8A;
    --primary-hover: #32476d;
    --primary-light: #f0f4f8;
    --secondary: #526490;
    --accent: #e06c75;
    --success: #2ec4b6;
    --warning: #ff9f1c;
    --danger: #e71d36;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Header style */
.header-banner {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    padding: 1.5rem;
    text-align: center;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
    border-bottom: 2px solid var(--secondary);
}

/* Main Container */
.app-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Alert Info Section */
.custom-alert {
    background-color: var(--primary-light);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-bottom: 2rem;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.custom-alert h4 {
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.custom-alert ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.custom-alert li {
    margin-bottom: 0.25rem;
}

.close-alert {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .main-grid {
        grid-template-columns: 350px 1fr;
    }
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: var(--primary-light);
    color: var(--primary);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-select, .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-select:focus, .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(65, 91, 138, 0.15);
    background-color: #ffffff;
}

.search-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.btn-search {
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-search:hover {
    background-color: var(--primary-hover);
}

.btn-search:active {
    transform: scale(0.97);
}

.btn-search:disabled {
    background-color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Table Style */
.table-responsive {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.custom-table th {
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 1rem;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

.custom-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

.custom-table tbody tr {
    transition: background-color 0.15s ease;
}

.custom-table tbody tr:hover {
    background-color: var(--bg-main);
}

/* Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.spinner {
    font-size: 2.5rem;
    color: var(--primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Detail View Layout */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 992px) {
    .detail-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.detail-row {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 0.5rem;
    font-size: 0.95rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 35%;
    font-weight: 600;
    color: var(--text-muted);
}

.detail-value {
    width: 65%;
    color: var(--text-main);
    word-break: break-word;
}

/* S3 Media Gallery */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.media-card {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4/3;
    cursor: pointer;
}

.media-card img, .media-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.media-card:hover img {
    transform: scale(1.05);
}

.star-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.6);
    color: gold;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    backdrop-filter: blur(4px);
}

/* Toast override */
#toast-container > div {
    opacity: 1 !important;
    box-shadow: var(--shadow-lg) !important;
    border-radius: var(--radius-sm) !important;
    font-family: inherit !important;
}
