/* Reset and base styles for cross-browser compatibility */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

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

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

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 2.8rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

header p.tagline {
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Support Banner */
.support-banner {
    background: rgba(255,255,255,0.15);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
    backdrop-filter: blur(5px);
}

.support-banner p {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

/* Tool Section - Priority styling */
.tool-section {
    margin-bottom: 50px;
}

/* Role Selection - Enhanced styling */
.role-selection {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.role-selection h2 {
    margin-bottom: 30px;
    color: #667eea;
}

.role-btn {
    padding: 15px 40px;
    margin: 0 20px;
    font-size: 1.2rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    min-width: 200px;
}

.role-btn.teacher {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
}

.role-btn.student {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
}

.role-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Interface styling */
.interface {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* Teacher/Student Controls */
.teacher-controls, .student-controls {
    margin-bottom: 30px;
}

.session-controls, .join-session {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 20px;
}

input[type="text"], select, textarea {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    flex: 1;
    min-width: 200px;
}

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

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 150px;
}

.btn.primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn.secondary {
    background: linear-gradient(45deg, #ff9a9e, #fad0c4);
    color: #333;
}

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

.session-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    border-left: 4px solid #667eea;
}

.session-info p {
    margin: 5px 0;
    font-size: 1rem;
}

.responses-container {
    margin-top: 30px;
}

.responses-container h3 {
    margin-bottom: 20px;
    color: #667eea;
    text-align: center;
}

.responses-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.response-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #4ecdc4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: fadeIn 0.5s ease-in;
}

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

.response-content {
    margin-bottom: 10px;
    word-wrap: break-word;
}

.response-timestamp {
    font-size: 0.8rem;
    color: #666;
}

.student-input {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
}

.student-responses {
    margin-top: 30px;
}

.student-responses h3 {
    margin-bottom: 20px;
    color: #667eea;
    text-align: center;
}

/* Features Section */
.features-section {
    margin: 60px 0 50px 0;
}

.features-section h2 {
    text-align: center;
    font-size: 2.2rem;
    color: #333;
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.feature-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: #667eea;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
}

.feature-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature-card p {
    color: #555;
    font-size: 1rem;
}

/* How It Works Section - FIXED ALIGNMENT */
.how-it-works {
    margin: 50px 0;
    padding: 40px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
}

.how-it-works h2 {
    text-align: center;
    font-size: 2.2rem;
    color: #333;
    margin-bottom: 40px;
}

.steps {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.step {
    background: white;
    border-radius: 15px;
    padding: 25px;
    width: 280px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.step:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
    margin-right: 0 !important;
}

.step-content {
    text-align: center;
}

.step h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.3rem;
}

.step p {
    color: #555;
    font-size: 1rem;
    margin: 0;
}

/* About Section */
.about-section {
    margin: 50px 0;
    padding: 40px 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 15px;
}

.about-section h2 {
    text-align: center;
    font-size: 2.2rem;
    color: #333;
    margin-bottom: 30px;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-content p {
    margin-bottom: 20px;
    color: #555;
    font-size: 1rem;
    line-height: 1.8;
}

.about-content h3 {
    color: #667eea;
    margin: 30px 0 15px 0;
    font-size: 1.5rem;
}

/* Support Section Pages */
.support-section-page {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin: 40px 0;
    text-align: center;
    border-left: 4px solid #ff6b6b;
}

.support-section-page h3 {
    color: #ff6b6b;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.support-section-page p {
    color: #555;
    font-size: 1.1rem;
    margin-bottom: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Contact, Privacy Pages */
.contact-page, .privacy-page {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 30px;
    margin-bottom: 30px;
}

.contact-content, .privacy-content {
    max-width: 800px;
    margin: 0 auto;
}

.contact-info, .privacy-section {
    margin-bottom: 30px;
}

.contact-info h4, .privacy-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.4rem;
    font-weight: 600;
}

.contact-content p,
.privacy-section p {
    color: #555;
    font-size: 1rem;
    margin-bottom: 15px;
    line-height: 1.6;
}

.contact-content ul,
.privacy-section ul {
    margin: 15px 0;
    padding-left: 20px;
}

.contact-content li,
.privacy-section li {
    margin-bottom: 8px;
    color: #555;
    font-size: 1rem;
    line-height: 1.6;
}

/* Last updated styling */
.last-updated {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-style: italic;
    text-align: center;
}

/* Footer Styles */
.main-footer {
    background: rgba(255,255,255,0.1);
    padding: 30px 20px;
    border-radius: 15px;
    margin-top: 50px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #ddd;
    text-decoration: underline;
}

.main-footer p {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    .support-banner {
        padding: 15px;
    }
    
    .role-selection {
        padding: 20px;
    }
    
    .role-btn {
        display: block;
        width: 100%;
        margin: 10px 0;
        max-width: 300px;
    }
    
    .session-controls,
    .join-session {
        flex-direction: column;
    }
    
    input[type="text"],
    select,
    textarea {
        min-width: 100%;
    }
    
    .features-grid,
    .steps {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .step {
        width: 100%;
        max-width: 300px;
    }
    
    .responses-list {
        grid-template-columns: 1fr;
    }
}

/* MC and Word Cloud styles */
.mc-student-interface {
    text-align: center;
    margin: 20px 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid #667eea;
}

.mc-student-interface h3 {
    margin-bottom: 25px;
    color: #667eea;
    font-size: 1.4rem;
}

.mc-simple-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.mc-simple-btn {
    width: 80px;
    height: 80px;
    font-size: 2rem;
    font-weight: bold;
    border: 3px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mc-simple-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.mc-results {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mc-chart {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.mc-bar {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mc-label {
    font-weight: bold;
    min-width: 40px;
    font-size: 1.2rem;
    color: #333;
    text-align: center;
}

.mc-bar-fill {
    flex: 1;
    height: 30px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    border-radius: 15px;
    font-weight: bold;
    min-width: 50px;
}

.word-cloud-section {
    margin-top: 30px;
}

.word-cloud-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    min-height: 200px;
    align-items: center;
    justify-content: center;
}

.word-cloud-word {
    display: inline-block;
    padding: 5px 10px;
    background: #f0f8ff;
    border-radius: 15px;
    border: 1px solid #d1e7ff;
    transition: transform 0.2s ease;
}

.word-cloud-word:hover {
    transform: scale(1.1);
    background: #e6f3ff;
}

/* Ko-fi specific styling */
.ko-fi-button {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}