/* style.css - Complete Stylesheet for School Joke Tools */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4361ee;
    --secondary: #3a0ca3;
    --accent: #f72585;
    --light: #f8f9fa;
    --dark: #212529;
    --warning: #f8961e;
    --success: #4cc9f0;
    --border-radius: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Nunito', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #f0f2f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 1.5rem 0;
    text-align: center;
    box-shadow: var(--shadow);
}

header h1 {
    font-family: 'Comic Neue', cursive;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    font-style: italic;
}

/* Navigation */
nav {
    background-color: white;
    border-bottom: 3px solid var(--accent);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.nav-links {
    display: flex;
    list-style: none;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-links li {
    margin: 0;
}

.nav-links a {
    display: block;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: var(--dark);
    font-weight: 600;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

.nav-links a:hover {
    color: var(--primary);
    background-color: rgba(67, 97, 238, 0.05);
}

.nav-links a.active {
    color: var(--primary);
    border-bottom: 3px solid var(--accent);
}

.nav-links i {
    margin-right: 8px;
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.hero h2 {
    color: var(--secondary);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #555;
}

.hero-image {
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Tools Grid */
.tools-grid h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--secondary);
    font-size: 2rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.tool-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--dark);
    transition: var(--transition);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    color: var(--primary);
}

.card-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.card-icon i {
    font-size: 1.8rem;
    color: white;
}

.tool-card h3 {
    margin-bottom: 0.8rem;
    font-size: 1.4rem;
}

.tool-card p {
    color: #666;
    font-size: 0.95rem;
}

/* Testimonial */
.testimonial {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.testimonial h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--secondary);
}

.testimonial-content {
    position: relative;
    padding: 1.5rem;
    background-color: rgba(67, 97, 238, 0.05);
    border-radius: var(--border-radius);
}

.quote-icon {
    position: absolute;
    top: -15px;
    left: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

blockquote {
    font-style: italic;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 4px solid var(--accent);
}

.author {
    text-align: right;
    font-weight: 600;
    color: var(--secondary);
}

/* Footer */
footer {
    background-color: var(--dark);
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
}

.disclaimer {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Page-specific styles */
.page-header {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.page-header h2 {
    color: var(--secondary);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #666;
}

.content-box {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

/* Form Elements */
.input-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--secondary);
}

input, textarea, select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

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

textarea {
    min-height: 120px;
    resize: vertical;
}

button {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 8px rgba(67, 97, 238, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(67, 97, 238, 0.4);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Result Box */
.result-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: rgba(67, 97, 238, 0.05);
    border-radius: var(--border-radius);
    border-left: 5px solid var(--primary);
    animation: fadeIn 0.5s ease;
}

.result-box h3 {
    color: var(--secondary);
    margin-bottom: 0.8rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Wheel Styles - Canvas-based version - FIXED PROPERLY */
.wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2rem 0;
}

.wheel-wrapper {
    position: relative;
    width: 316px; /* Canvas (300px) + border (8px on each side) */
    height: 316px;
    margin: 0 auto 2rem;
}

.wheel-canvas {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    border: 8px solid var(--secondary);
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.21, 0.99);
    background-color: #f8f9fa; /* Fallback background */
}

/* FIXED ARROW POSITIONING - FINAL CORRECTION */
.wheel-pointer {
    position: absolute;
    top: -20px; /* TIP OF ARROW POINTS TO TOP OF CANVAS: -20px positions 40px arrow tip at top edge */
    left: 50%;
    transform: translateX(-50%) translateY(0);
    width: 40px;
    height: 40px;
    z-index: 10;
    text-align: center;
    pointer-events: none; /* Prevent interference with clicks */
}

.wheel-pointer i {
    font-size: 40px;
    color: var(--accent);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    z-index: 5;
    border: 5px solid var(--secondary);
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

/* ALTERNATIVE SOLUTION - If the above doesn't work, try this positioning: */
/* .wheel-pointer {
    position: absolute;
    top: -8px;  Position arrow 8px above the canvas (border width) 
    left: 50%;
    transform: translateX(-50%) translateY(-100%);  Move up by 100% of arrow height 
    width: 40px;
    height: 40px;
    z-index: 10;
    text-align: center;
    pointer-events: none;
} */

.names-list {
    margin-top: 2rem;
    width: 100%;
    max-width: 500px;
}

.name-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.name-input {
    flex: 1;
    margin-right: 10px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
    margin-bottom: 0;
}

.remove-name {
    background: var(--accent);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Quiz Styles */
.quiz-question {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.quiz-question:last-child {
    border-bottom: none;
}

.quiz-question h3 {
    margin-bottom: 1rem;
    color: var(--secondary);
}

.options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.option {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.option:hover {
    background-color: #e9ecef;
}

.option.selected {
    background-color: rgba(67, 97, 238, 0.1);
    border: 2px solid var(--primary);
}

.option input {
    width: auto;
    margin-right: 0.8rem;
}

/* Click Counter */
.click-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.click-button {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 2rem;
    transition: all 0.2s;
}

.click-button:active {
    transform: scale(0.95);
}

.counter-display {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.roast-message {
    font-size: 1.2rem;
    text-align: center;
    min-height: 60px;
    padding: 1rem;
    border-radius: var(--border-radius);
    background-color: rgba(248, 37, 133, 0.1);
    width: 100%;
    max-width: 600px;
}

/* Excuse Ideas */
.excuse-ideas {
    list-style-type: none;
    padding-left: 1rem;
}

.excuse-ideas li {
    margin-bottom: 0.8rem;
    padding-left: 1rem;
    position: relative;
}

.excuse-ideas li:before {
    content: "•";
    color: var(--accent);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Results Explained */
.results-explained {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: rgba(67, 97, 238, 0.05);
    border-radius: var(--border-radius);
}

.results-explained h4 {
    margin-bottom: 0.8rem;
    color: var(--secondary);
}

.results-explained ul {
    padding-left: 1.5rem;
}

.results-explained li {
    margin-bottom: 0.5rem;
}

/* Error messages */
.error-message {
    color: #ff6b6b;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

/* Loading spinner */
.fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Tooltip */
.tooltip {
    position: absolute;
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 1000;
    white-space: nowrap;
    pointer-events: none;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .nav-links {
        justify-content: space-around;
    }
    
    .nav-links a {
        padding: 0.8rem 0.5rem;
        font-size: 0.9rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    /* Fixed responsive wheel dimensions */
    .wheel-wrapper {
        width: 266px; /* 250px canvas + 8px border each side */
        height: 266px;
    }
    
    .wheel-canvas {
        width: 250px;
        height: 250px;
    }
    
    .wheel-pointer {
        top: -17px; /* Adjusted for smaller canvas */
    }
    
    .wheel-pointer i {
        font-size: 35px;
    }
    
    .hero-image {
        height: 200px;
    }
    
    .click-button {
        width: 180px;
        height: 180px;
    }
    
    .counter-display {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .nav-links {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a {
        text-align: center;
        padding: 0.8rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    /* Fixed responsive wheel dimensions */
    .wheel-wrapper {
        width: 216px; /* 200px canvas + 8px border each side */
        height: 216px;
    }
    
    .wheel-canvas {
        width: 200px;
        height: 200px;
        border-width: 6px;
    }
    
    .wheel-pointer {
        top: -13px; /* Adjusted for smaller canvas */
    }
    
    .wheel-pointer i {
        font-size: 30px;
    }
    
    .wheel-center {
        width: 30px;
        height: 30px;
        border-width: 4px;
    }
    
    .click-button {
        width: 150px;
        height: 150px;
        font-size: 1.2rem;
    }
    
    .counter-display {
        font-size: 1.5rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .tools-grid h2 {
        font-size: 1.5rem;
    }
    
    .page-header h2 {
        font-size: 1.5rem;
    }
    
    .result-box h3 {
        font-size: 1.2rem;
    }
}