/* Quiz Generator Styles - Mobile First Design */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 15px;
    color: #333;
}

/* Main Title */
h1 {
    text-align: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

body > p {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    margin-bottom: 25px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Form Container */
#quiz-form {
    max-width: 100%;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Teams Section */
#teams {
    display: block;
}

#teams h2 {
    color: #2d3436;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Input Styles */
input[type="text"] {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

input[type="text"]:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
    transform: translateY(-1px);
}

input[type="text"]::placeholder {
    color: #999;
    font-style: italic;
}

/* Special styling for team inputs */
#green-team {
    border-left: 5px solid #00b894;
}

#red-team {
    border-left: 5px solid #e17055;
}

#blue-team {
    border-left: 5px solid #74b9ff;
}

#yellow-team {
    border-left: 5px solid #fdcb6e;
}

/* Button Styles */
button {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Primary button (Next, Generate Quiz) */
button[onclick="next()"],
button[onclick="generateQuiz()"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

button[onclick="next()"]:hover,
button[onclick="generateQuiz()"]:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(102, 126, 234, 0.4);
}

/* Secondary button (Back) */
button[onclick="back()"] {
    background: linear-gradient(135deg, #a8a8a8 0%, #888888 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

button[onclick="back()"]:hover {
    background: linear-gradient(135deg, #999999 0%, #777777 100%);
    transform: translateY(-1px);
}

/* Add Topic button */
button[onclick="addTopic()"] {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(0, 184, 148, 0.3);
    margin-bottom: 20px;
}

button[onclick="addTopic()"]:hover {
    background: linear-gradient(135deg, #00a085 0%, #009975 100%);
    transform: translateY(-2px);
}

#questions h2 {
    color: #2d3436;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* New Topic Input */
#new-topic {
    margin-bottom: 10px;
    border-left: 5px solid #4facfe;
}

/* Question Container */
#question-container {
    display: block !important;
    margin-bottom: 20px;
}

/* Question pair container */
.question-pair {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(79, 172, 254, 0.05);
    border-radius: 8px;
    border-left: 3px solid #4facfe;
}

.question-pair input[type="text"]:first-child {
    margin-bottom: 8px;
}

.question-pair input[type="text"]:last-child {
    margin-bottom: 0;
}

/* Topic Sections */
.topic {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #4facfe;
}

.topic h2 {
    color: #2d3436;
    font-size: 18px;
    margin-bottom: 15px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* Question and Answer Inputs in Topics */
.topic input[type="text"] {
    margin-bottom: 8px;
    padding: 12px;
    font-size: 14px;
}

.topic input[type="text"]:nth-of-type(odd) {
    border-left: 4px solid #667eea;
}

.topic input[type="text"]:nth-of-type(even) {
    border-left: 4px solid #00b894;
    margin-bottom: 15px;
}

/* Remove Topic Button */
button[onclick^="removeTopic"] {
    background: linear-gradient(135deg, #e17055 0%, #d63031 100%);
    color: white;
    padding: 10px;
    font-size: 14px;
    margin-top: 10px;
    box-shadow: 0 3px 10px rgba(225, 112, 85, 0.3);
}

button[onclick^="removeTopic"]:hover {
    background: linear-gradient(135deg, #d63031 0%, #c72c2c 100%);
    transform: translateY(-1px);
}

/* Action buttons section */
.action-buttons {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.action-buttons button {
    margin-bottom: 15px;
}

/* Output URL Field */
#output {
    background: #f8f9fa;
    border: 2px solid #00b894;
    color: #2d3436;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    margin-top: 15px;
    user-select: all;
}

#output:focus {
    background: #e8f5e8;
    border-color: #00a085;
}

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

button:disabled:hover {
    transform: none !important;
}

/* Responsive Design - Tablet */
@media (min-width: 768px) {
    body {
        padding: 30px;
    }
    
    h1 {
        font-size: 32px;
        margin-bottom: 15px;
    }
    
    body > p {
        font-size: 18px;
        margin-bottom: 35px;
    }
    
    #quiz-form {
        max-width: 600px;
        padding: 35px;
    }
    
    input[type="text"] {
        padding: 18px;
        font-size: 16px;
    }
    
    button {
        padding: 18px;
        font-size: 16px;
    }
    
    .topic {
        padding: 25px;
    }
    
    .topic h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .topic input[type="text"] {
        padding: 15px;
        font-size: 15px;
    }
    
    #output {
        font-size: 15px;
    }
}

/* Responsive Design - Desktop */
@media (min-width: 1024px) {
    body {
        padding: 40px;
    }
    
    h1 {
        font-size: 36px;
        margin-bottom: 20px;
    }
    
    body > p {
        font-size: 20px;
        margin-bottom: 40px;
    }
    
    #quiz-form {
        max-width: 800px;
        padding: 50px;
    }
    
    input[type="text"] {
        padding: 20px;
        font-size: 17px;
    }
    
    button {
        padding: 20px;
        font-size: 17px;
    }
    
    .topic {
        padding: 30px;
    }
    
    .topic h2 {
        font-size: 22px;
        margin-bottom: 25px;
    }
    
    .topic input[type="text"] {
        padding: 16px;
        font-size: 16px;
    }
    
    #output {
        font-size: 16px;
    }
    
    /* Desktop: Side by side layout for question/answer pairs */
    .topic {
        position: relative;
    }
    
    /* Two column layout for questions and answers on desktop */
    @supports (display: grid) {
        .question-pair {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-bottom: 10px;
        }
    }
}

/* Animation for smooth transitions */
.topic {
    animation: slideIn 0.3s ease-out;
}

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

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Button click animation */
button.clicked {
    animation: buttonClick 0.2s ease;
}

@keyframes buttonClick {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Focus states for accessibility */
input[type="text"]:focus,
button:focus {
    outline: 3px solid #4facfe;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    input[type="text"] {
        border-width: 3px;
    }
    
    button {
        border: 2px solid #000;
    }
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    #quiz-form {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    button {
        display: none;
    }
}