/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #dc2626;
    --primary-light: #fef2f2;
    --primary-dark: #b91c1c;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1e293b;
    --light-bg: #fef2f2;
    --card-bg: #ffffff;
    --border-color: #fecaca;
    --text-color: #44403c;
    --border-radius: 10px;
    --box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, #fef2f2 0%, #ffe4e6 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;
}

h1 {
    font-size: 2.5rem;
    color: var(--dark-color);
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
}

.tagline {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-weight: 500;
}

.back-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    background: var(--primary-light);
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary-dark);
    background: #fee2e2;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Card Styles */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

/* Form Styles */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.95rem;
}

.form-group input[type="tel"],
.form-group input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #fecaca;
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
    background: var(--primary-light);
    color: var(--text-color);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--secondary-color);
    font-size: 0.85rem;
}

/* Network Selection */
.network-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.network-option {
    position: relative;
}

.network-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.network-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    border: 2px solid #fecaca;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    background: var(--primary-light);
}

.network-option input:checked + label {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.network-option label:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.network-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.network-option span {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.9rem;
}

/* Button Styles */
.btn-primary,
.btn-secondary,
.btn-success {
    display: inline-block;
    padding: 16px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: var(--transition);
    width: 100%;
    margin-top: 10px;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-color);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: #0da271;
    transform: translateY(-3px);
}

/* Warning Box */
.warning-box {
    background: #fef3c7;
    border-left: 4px solid var(--warning-color);
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    border: 1px solid #fde68a;
}

.warning-box h3 {
    color: #92400e;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-box p {
    color: #78350f;
    margin-bottom: 8px;
    font-size: 0.9rem;
    padding-left: 5px;
}

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.step {
    text-align: center;
    padding: 25px 20px;
    background: var(--primary-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.2);
}

.step h3 {
    margin-bottom: 10px;
    color: var(--dark-color);
    font-size: 1.2rem;
}

.step p {
    color: var(--secondary-color);
    font-size: 0.95rem;
}

/* Quiz Styles */
.quiz-progress {
    margin-bottom: 30px;
}

.progress-bar {
    height: 8px;
    background: #fed7d7;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    width: 20%;
    transition: width 0.5s ease;
}

#progressText {
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.question {
    display: none;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.question.active {
    display: block;
}

.question h2 {
    margin-bottom: 25px;
    font-size: 1.4rem;
    color: var(--dark-color);
    line-height: 1.4;
}

.options {
    display: grid;
    gap: 12px;
}

.option {
    position: relative;
}

.option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option label {
    display: block;
    padding: 18px 20px;
    background: var(--primary-light);
    border: 2px solid #fecaca;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    color: var(--text-color);
}

.option input:checked + label {
    border-color: var(--primary-color);
    background: var(--primary-light);
    color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
}

.option label:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.quiz-controls {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.quiz-controls button {
    flex: 1;
}

/* Result Container */
.result-container {
    text-align: center;
    padding: 30px;
    margin-top: 20px;
    background: var(--primary-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: none;
    animation: fadeIn 0.5s ease;
}

.success-message h2,
.error-message h2 {
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.success-message {
    color: var(--success-color);
}

.error-message {
    color: var(--danger-color);
}

/* =========================================== */
/* SPIN WHEEL STYLES - UPDATED */
/* =========================================== */

/* Bigger wheel container */
.wheel-container {
    text-align: center;
    margin: 40px 0;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.1);
    border: 1px solid #fecaca;
}

.wheel-wrapper {
    position: relative;
    display: inline-block;
    margin: 20px auto;
}

/* Bigger wheel canvas */
#wheelCanvas {
    display: block;
    margin: 0 auto;
    border-radius: 50%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border: 8px solid white;
    background: white;
}

/* Centered spin button */
.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.spin-pointer {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3.5rem;
    color: #dc2626;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 20;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from { transform: translateX(-50%) translateY(0); }
    to { transform: translateX(-50%) translateY(-10px); }
}

.spin-btn {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    border: none;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.spin-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(220, 38, 38, 0.6);
}

.spin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Wheel legend improvements */
.wheel-legend {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 12px 15px;
    border-radius: 10px;
    border: 2px solid #fecaca;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.color-box {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.color-box.lose { background: #94a3b8; }
.color-box.win-100 { background: #10b981; }
.color-box.win-200 { background: #3b82f6; }
.color-box.win-500 { background: #f59e0b; }

/* Spin loading overlay */
.spin-loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
}

.spin-loading.active {
    display: flex;
}

.spin-loading .spinner {
    width: 70px;
    height: 70px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top: 6px solid #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 25px;
}

.spin-loading h3 {
    font-size: 1.5rem;
    color: white;
    margin-top: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* User Info */
.user-info {
    background: var(--primary-light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid var(--primary-color);
    border: 1px solid var(--border-color);
}

.user-info h2 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: var(--dark-color);
}

.user-info p {
    margin-bottom: 8px;
    color: var(--secondary-color);
}

/* Probability Info */
.probability-info {
    background: var(--primary-light);
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
    border: 1px solid var(--border-color);
}

.probability-info h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
    font-size: 1.2rem;
}

.probability-info ul {
    list-style: none;
    padding-left: 0;
}

.probability-info li {
    padding: 10px 0;
    border-bottom: 1px solid #fecaca;
    color: var(--text-color);
}

.probability-info li:last-child {
    border-bottom: none;
}

.probability-info .note {
    margin-top: 15px;
    font-style: italic;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Ad Placeholders */
.ad-placeholder {
    background: white;
    border: 2px dashed #fecaca;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin: 25px auto;
    color: #94a3b8;
}

.ad-label {
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ad-content {
    font-size: 1rem;
    font-weight: 500;
    color: var(--secondary-color);
}

.top-ad, .footer-ad {
    max-width: 728px;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.middle-ad, .question-ad {
    max-width: 300px;
    min-height: 250px;
    margin: 25px auto;
}

.pre-button-ad, .pre-submit-ad {
    max-width: 336px;
    min-height: 280px;
    margin: 25px auto;
}

/* Privacy Policy Styles */
.privacy-container .card {
    max-width: 800px;
    margin: 0 auto 30px;
}

.privacy-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #fecaca;
}

.privacy-section:last-child {
    border-bottom: none;
}

.privacy-section h3 {
    color: var(--primary-dark);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.privacy-section ul {
    padding-left: 20px;
    margin: 15px 0;
}

.privacy-section li {
    margin-bottom: 10px;
    color: var(--secondary-color);
    line-height: 1.5;
}

.privacy-acknowledgment {
    background: var(--primary-light);
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
    text-align: center;
    border-left: 4px solid var(--primary-color);
    border: 1px solid var(--border-color);
}

.navigation-links {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.navigation-links a {
    flex: 1;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    color: var(--secondary-color);
    border-top: 1px solid #fecaca;
    margin-top: 40px;
}

footer p {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .wheel-legend {
        grid-template-columns: 1fr;
    }
    
    .spin-btn {
        width: 80px;
        height: 80px;
        font-size: 1.2rem;
    }
}

/* Base Nav */
.main-nav {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 25px;
    box-shadow: var(--box-shadow);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    border: 1px solid var(--border-color);
}

.main-nav a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    background: var(--primary-light);
    transition: var(--transition);
}

.main-nav a:hover, .main-nav a.active {
    background: var(--primary-color);
    color: white;
}

/* Articles */
.seo-article {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
}

.seo-article h2 {
    color: var(--primary-dark);
    margin-top: 20px;
    margin-bottom: 15px;
}

.seo-article h3 {
    color: var(--dark-color);
    margin-top: 15px;
    margin-bottom: 10px;
}

.seo-article p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.seo-article ul, .seo-article ol {
    margin-bottom: 15px;
    padding-left: 20px;
}

.seo-article li {
    margin-bottom: 8px;
}

    h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .network-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .quiz-controls {
        flex-direction: column;
    }
    
    .navigation-links {
        flex-direction: column;
    }
    
    .wheel-legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .legend-item {
        width: 100%;
    }
    
    .wheel-container {
        padding: 20px;
    }
    
    #wheelCanvas {
        width: 320px;
        height: 320px;
    }
    
    .wheel-legend {
        grid-template-columns: 1fr;
        max-width: 300px;
    }
    
    .spin-btn {
        width: 90px;
        height: 90px;
        font-size: 1.2rem;
    }
    
    .spin-pointer {
        top: -50px;
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .network-grid {
        grid-template-columns: 1fr;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-success {
        padding: 14px 24px;
    }
    
    #wheelCanvas {
        width: 280px;
        height: 280px;
    }
    
    .spin-btn {
        width: 80px;
        height: 80px;
        font-size: 1.1rem;
    }
    
    .wheel-container {
        padding: 15px;
    }
}

/* Result animations */
@keyframes celebrate {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.success-message {
    animation: celebrate 0.8s ease-out;
}

@keyframes sadEnter {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.error-message {
    animation: sadEnter 0.6s ease-out;
}

/* Floating animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.success-message h2 {
    animation: float 2s infinite ease-in-out;
}