:root {
    --primary: #2575fc;
    --primary-dark: #1a5fd4;
    --secondary: #6a11cb;
    --gradient: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    --white: #ffffff;
    --text-dark: #1a1a2e;
    --text-muted: #555;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-lg: 16px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--text-dark);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===== Auth pages ===== */
.page-auth {
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

.page-auth--dark {
    background: #111;
}

.auth-card {
    background: var(--white);
    padding: clamp(24px, 5vw, 36px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-card h2 {
    margin: 0 0 20px;
    font-size: clamp(1.25rem, 4vw, 1.5rem);
}

.auth-card input,
.auth-card select,
.auth-card textarea {
    width: 100%;
    padding: 12px 14px;
    margin: 8px 0;
    border-radius: var(--radius);
    border: 1px solid #ddd;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.auth-card input:focus,
.auth-card select:focus,
.auth-card textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.auth-card button,
.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: background 0.2s, transform 0.15s;
}

.auth-card button:hover,
.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-dark {
    background: #111;
}

.btn-dark:hover {
    background: #333;
}

.auth-link {
    display: inline-block;
    margin-top: 14px;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.95rem;
}

.auth-link:hover {
    text-decoration: underline;
}

.top-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.75);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.top-btn:hover {
    background: #000;
}

.error-msg {
    color: #e74c3c;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

/* ===== Main pages ===== */
.page-main {
    background: var(--gradient);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(20px, 4vw, 40px) clamp(12px, 3vw, 24px);
}

.page-title {
    color: var(--white);
    text-align: center;
    margin: 0 0 clamp(24px, 5vw, 40px);
    font-size: clamp(1.5rem, 5vw, 2rem);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Section grid */
.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: clamp(16px, 3vw, 24px);
    width: 100%;
    max-width: 960px;
}

.section-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--white);
    color: var(--text-dark);
    padding: 12px;
    text-decoration: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    aspect-ratio: 1;
    max-width: 280px;
    margin: 0 auto;
    width: 100%;
}

.section-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
}

.section-card img {
    width: 100%;
    flex: 1;
    min-height: 0;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
}

.section-card span {
    font-weight: 700;
    text-align: center;
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    padding: 4px 8px;
}

/* Large nav buttons (f1) */
.nav-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(16px, 4vw, 28px);
    width: 100%;
    max-width: 700px;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    color: var(--text-dark);
    padding: clamp(20px, 5vw, 32px) clamp(40px, 10vw, 80px);
    text-decoration: none;
    font-size: clamp(1.1rem, 3.5vw, 1.5rem);
    font-weight: 700;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: min(280px, 100%);
}

.nav-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.empty-msg {
    color: var(--white);
    text-align: center;
    font-size: 1.1rem;
    opacity: 0.95;
}

/* ===== Cards list (section.php) ===== */
.search-box {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: none;
    font-size: 16px;
    margin: 0 auto 28px;
    display: block;
    box-shadow: var(--shadow);
}

.cards-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 600px;
}

.actor-card {
    width: 100%;
    background: var(--white);
    padding: clamp(12px, 3vw, 18px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: clamp(12px, 3vw, 18px);
}

.actor-card img {
    width: clamp(70px, 18vw, 90px);
    height: clamp(70px, 18vw, 90px);
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.actor-info {
    flex: 1;
    min-width: 0;
}

.actor-info h3 {
    margin: 0 0 6px;
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: var(--text-dark);
}

.actor-info p {
    margin: 0 0 10px;
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    color: var(--text-muted);
    line-height: 1.5;
    word-break: break-word;
}

.whatsapp-btn {
    display: inline-block;
    background: #25d366;
    color: var(--white);
    padding: 8px 16px;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s;
}

.whatsapp-btn:hover {
    background: #1da851;
}

.back-link {
    color: var(--white);
    text-decoration: none;
    margin-bottom: 16px;
    font-size: 0.95rem;
    opacity: 0.9;
    align-self: flex-start;
    max-width: 600px;
    width: 100%;
}

.back-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ===== Admin dashboard ===== */
.page-admin {
    background: #f0f2f5;
    min-height: 100vh;
    padding: clamp(16px, 4vw, 32px);
}

.admin-header {
    max-width: 900px;
    margin: 0 auto 24px;
}

.admin-header h1 {
    margin: 0;
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    color: var(--text-dark);
}

.admin-panel {
    background: var(--white);
    padding: clamp(16px, 4vw, 24px);
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.admin-panel h2 {
    margin: 0 0 16px;
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    color: var(--text-dark);
}

.admin-panel h3 {
    margin: 20px 0 12px;
    font-size: 1rem;
    color: var(--text-muted);
}

.admin-panel input,
.admin-panel select,
.admin-panel textarea {
    width: 100%;
    padding: 10px 12px;
    margin: 6px 0;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
}

.admin-panel textarea {
    min-height: 80px;
    resize: vertical;
}

.admin-panel button {
    margin-top: 8px;
    padding: 10px 20px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    width: 100%;
}

.admin-panel button:hover {
    background: var(--primary-dark);
}

.list-item {
    background: #f8f9fa;
    padding: 10px 12px;
    margin: 8px 0;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.list-item img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.list-item-text {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
    word-break: break-word;
}

.delete-link {
    color: #e74c3c;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.delete-link:hover {
    text-decoration: underline;
}

/* ===== Responsive tweaks ===== */
@media (max-width: 480px) {
    .actor-card {
        flex-direction: column;
        text-align: center;
    }

    .actor-card img {
        width: 100%;
        height: 180px;
        max-width: 200px;
    }

    .top-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}
