/* QuickPoll - Modern Poll System */

/* 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;
    color: #333;
    line-height: 1.6;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.create-new {
    display: inline-block;
    margin-top: 10px;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 25px;
    transition: all 0.3s;
    font-weight: 500;
}

.create-new:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

/* Cards */
.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-2px);
}

.poll-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

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

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

input[type="text"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: #fafbfc;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

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

/* Options Input */
.option-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.option-input input {
    flex: 1;
    margin-bottom: 0;
}

.remove-option {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.3s;
}

.remove-option:hover {
    background: #ff3742;
}

/* Checkboxes */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 10px;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #e1e8ed;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e8ed;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #d1d8dd;
}

/* Poll Display */
.poll-header h2 {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: #333;
}

.poll-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 20px;
}

/* Vote Form */
.vote-form {
    margin: 30px 0;
}

.options-list {
    margin-bottom: 20px;
}

.option-item {
    display: block;
    margin-bottom: 10px;
    padding: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafbfc;
}

.option-item:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

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

.option-item.selected {
    border-color: #667eea;
    background: #f0f2ff;
}

.option-text {
    font-size: 16px;
    font-weight: 500;
}

.vote-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
}

/* Results */
.results-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.results-section h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #333;
}

.result-item {
    margin-bottom: 15px;
}

.result-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-weight: 500;
}

.option-name {
    flex: 1;
}

.vote-count {
    font-size: 0.9em;
    color: #666;
    font-weight: 600;
}

.result-bar {
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.result-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.no-votes {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 20px 0;
}

.total-votes {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

/* Share Section */
.share-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.share-section h4 {
    margin-bottom: 10px;
    color: #555;
}

.share-input {
    display: flex;
    gap: 10px;
}

.share-input input {
    flex: 1;
    margin-bottom: 0;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Error/Expired Pages */
.error-card,
.expired-card {
    text-align: center;
    padding: 50px 30px;
}

.error-icon,
.expired-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.poll-question {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

/* Info Card */
.info-card {
    background: rgba(255,255,255,0.95);
    border-left: 4px solid #667eea;
}

.info-card h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.info-card ul {
    list-style: none;
    padding: 0;
}

.info-card li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-card li:last-child {
    border-bottom: none;
}

/* Replies Section */
.replies-section {
    margin-top: 40px;
    border-top: 1px solid #e1e8ed;
    padding-top: 30px;
}

.replies-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.replies-list {
    margin-bottom: 30px;
}

.reply-item {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease-out;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #666;
}

.reply-author {
    font-weight: 600;
    color: #333;
}

.reply-time {
    color: #999;
}

.reply-text {
    color: #333;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.no-replies {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #e1e8ed;
}

.add-reply-section {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 20px;
}

.add-reply-section h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
}

.reply-form .form-group {
    margin-bottom: 15px;
}

.reply-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

.reply-form input[type="text"],
.reply-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.reply-form input[type="text"]:focus,
.reply-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.char-count {
    display: block;
    text-align: right;
    font-size: 0.8em;
    color: #666;
    margin-top: 5px;
}

.reply-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.reply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

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

/* Add Option Section */
.add-option-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
}

.add-option-section h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1em;
}

.add-option-form .form-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.add-option-form input[type="text"] {
    flex: 1;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.3s;
}

.add-option-form input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.add-option-btn {
    white-space: nowrap;
    padding: 12px 16px;
    font-size: 14px;
}

/* Site Header and Footer */
.site-header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease;
    height: 48px;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0;
}

.site-header.hidden {
    transform: translateY(-100%);
}

.main-nav {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0 0 0 20px;
}

.nav-brand {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-brand li {
    margin: 0;
}

.nav-brand a {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.nav-brand a:hover {
    color: #667eea;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    margin-left: auto;
    justify-content: flex-end;
}

.nav-menu li {
    margin-left: 1rem;
}

.nav-link {
    color: #666;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.site-footer {
    background: #f8f9fa;
    border-top: 1px solid #e1e8ed;
    padding: 2rem 0;
    margin-top: 4rem;
}

.site-footer p {
    text-align: center;
    color: #666;
    margin: 0;
}

.site-footer a {
    color: #667eea;
    text-decoration: none;
}

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5em;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.3em;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.4;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.2em;
    font-weight: 600;
}

/* Features Section */
.features {
    padding: 4rem 0;
    text-align: center;
}

.features h2 {
    font-size: 2.5em;
    margin-bottom: 3rem;
    color: #333;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.feature-icon {
    font-size: 3em;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.3em;
    margin-bottom: 0.5rem;
    color: #333;
}

.feature-card p {
    color: #666;
    line-height: 1.5;
}

/* How it Works Section */
.how-it-works {
    padding: 4rem 0;
    background: #f8f9fa;
    text-align: center;
}

.how-it-works h2 {
    font-size: 2.5em;
    margin-bottom: 3rem;
    color: #333;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.step {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

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

.step h3 {
    font-size: 1.3em;
    margin-bottom: 0.5rem;
    color: #333;
}

.step p {
    color: #666;
    line-height: 1.5;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    border-radius: 15px;
    margin: 4rem 0;
}

.cta-section h2 {
    font-size: 2.5em;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.2em;
    margin-bottom: 2rem;
    opacity: 0.9;
}

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

    .header h1 {
        font-size: 2em;
    }

    .card {
        padding: 20px;
    }

    .poll-card {
        padding: 20px;
    }

    .form-row {
        flex-direction: column;
    }

    .poll-meta {
        flex-direction: column;
        gap: 5px;
    }

    .share-input {
        flex-direction: column;
    }

    .result-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .reply-item {
        padding: 12px;
    }

    .reply-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .add-reply-section {
        padding: 15px;
    }

    .reply-form textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .add-option-form .form-group {
        flex-direction: column;
        align-items: stretch;
    }

    .add-option-form input[type="text"] {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .hero {
        padding: 2rem 0;
    }

    .hero h1 {
        font-size: 2.5em;
    }

    .hero-subtitle {
        font-size: 1.1em;
    }

    .features h2,
    .how-it-works h2,
    .cta-section h2 {
        font-size: 2em;
    }

    .features-grid,
    .steps {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .nav {
        flex-direction: column;
        gap: 1rem;
    }

    .site-header .container {
        padding: 0 1rem;
    }
}

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

.card,
.poll-card {
    animation: fadeIn 0.5s ease-out;
}

/* Loading animation for results */
.results-list {
    animation: fadeIn 0.3s ease-out;
}
