/* =====================================================
   ANIPLAYHUB FORM WEBSITE - STYLES
   Matching hdd.aniplayhub.site theme
   ===================================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* CSS Variables */
:root {
    --primary: #E92071;
    --primary-hover: #d11d66;
    --primary-glow: rgba(233, 32, 113, 0.4);
    --bg-dark: #1C1719;
    --bg-card: #231e21;
    --border-color: #32292D;
    --text-primary: #ffffff;
    --text-secondary: #a8a2a5;
    --text-muted: #6b6568;
    --success: #22c55e;
    --error: #ef4444;
    --cyan-glow: rgba(34, 211, 238, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    width: 100%;
}

/* Hide number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Neon Glow Effects */
body::before,
body::after {
    content: '';
    position: fixed;
    left: 0;
    right: 0;
    height: 200px;
    pointer-events: none;
    z-index: 0;
}

body::before {
    top: 0;
    background: linear-gradient(180deg, var(--cyan-glow) 0%, transparent 100%);
}

body::after {
    bottom: 0;
    background: linear-gradient(0deg, var(--primary-glow) 0%, transparent 100%);
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease;
}

.logo-container:hover {
    transform: scale(1.02);
}

.logo-container:active {
    transform: scale(0.98);
}

.logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-text span {
    color: var(--primary);
}

/* Form Card */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.form-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.form-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
    font-size: 0.95rem;
}

/* Section Headers */
.section-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-label .required {
    color: var(--primary);
}

/* Input Styles */
.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input:hover:not(:focus) {
    border-color: #4a4145;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* Question Cards */
.question-card {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.question-card:hover {
    border-color: #4a4145;
}

.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 12px;
}

.question-text {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Radio Options */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-option:hover {
    border-color: var(--primary);
    background: rgba(233, 32, 113, 0.05);
}

.radio-option input[type="radio"] {
    display: none;
}

/* Hide the radio dot completely */
.radio-custom {
    display: none;
}

.radio-option input[type="radio"]:checked~.radio-label {
    color: var(--text-primary);
}

/* Make the A/B/C letter glow when selected */
.radio-option input[type="radio"]:checked~.radio-label strong {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow), 0 0 20px var(--primary-glow), 0 0 30px var(--primary-glow);
}

/* Style the label when selected */
.radio-option:has(input[type="radio"]:checked) {
    border-color: var(--primary);
    background: rgba(233, 32, 113, 0.1);
    box-shadow: 0 0 15px var(--primary-glow);
}

.radio-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    line-height: 1.4;
}

.radio-label strong {
    color: var(--primary);
    transition: all 0.3s ease;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px 32px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 32px;
}

.submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.submit-btn .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success Message */
.success-message {
    display: none;
    text-align: center;
    padding: 60px 40px;
}

.success-message.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 2.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(34, 197, 94, 0);
    }
}

.success-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.success-text {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.reset-btn {
    padding: 12px 32px;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.toast.success {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* =====================================================
   ADMIN PANEL STYLES
   ===================================================== */

/* Password Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    text-align: center;
    animation: modalIn 0.3s ease;
    margin: auto;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal .form-input {
    text-align: center;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.modal-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.3s ease;
}

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

.modal-error {
    color: var(--error);
    font-size: 0.9rem;
    margin-top: 12px;
    display: none;
}

/* Admin Layout */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.admin-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-badge {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.back-btn {
    padding: 10px 20px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Search & Filter */
.controls-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    padding-left: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b6568'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
    background-size: 20px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.export-btn {
    padding: 12px 24px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Data Table */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-dark);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: rgba(233, 32, 113, 0.05);
}

.data-table td {
    font-size: 0.95rem;
}

.answer-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.view-btn {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.delete-btn {
    padding: 8px 16px;
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 8px;
}

.delete-btn:hover {
    background: var(--error);
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Submission Detail Modal */
.detail-modal {
    max-width: 600px;
}

.detail-section {
    text-align: left;
    margin-bottom: 24px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-value {
    color: var(--text-primary);
    font-size: 1rem;
}

.detail-divider {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .form-card {
        padding: 20px;
        margin-bottom: 24px;
    }

    .form-title {
        font-size: 1.4rem;
    }

    .form-subtitle {
        font-size: 0.9rem;
    }

    .section-header {
        font-size: 1rem;
    }

    .question-card {
        padding: 16px;
    }

    .question-text {
        font-size: 0.95rem;
    }

    .radio-option {
        padding: 12px 14px;
    }

    .radio-label {
        font-size: 0.9rem;
    }

    .submit-btn {
        font-size: 1rem;
        padding: 14px 24px;
    }

    .admin-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    /* Mobile card-based table layout */
    .table-container {
        overflow-x: visible;
        background: transparent;
        border: none;
    }

    .data-table {
        min-width: unset;
        display: block;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .data-table tr {
        display: flex;
        flex-direction: column;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
        padding: 16px;
    }

    .data-table tr:hover td {
        background: transparent;
    }

    .data-table td {
        padding: 6px 0;
        border-bottom: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.85rem;
        text-transform: uppercase;
    }

    .data-table td:last-child {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--border-color);
    }

    .view-btn {
        width: 100%;
        padding: 12px 24px;
        font-size: 1rem;
    }

    .empty-state {
        display: block !important;
    }

    .empty-state::before {
        display: none;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 16px 0;
        margin-bottom: 24px;
    }

    .logo {
        width: 40px;
        height: 40px;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .form-card {
        padding: 16px;
        border-radius: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-input {
        padding: 12px 14px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .question-number {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
        margin-right: 8px;
    }

    .radio-custom {
        width: 18px;
        height: 18px;
        min-width: 18px;
    }

    .radio-custom::after {
        width: 6px;
        height: 6px;
    }

    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .success-title {
        font-size: 1.25rem;
    }

    .footer {
        padding: 20px 0;
        font-size: 0.8rem;
    }
}