/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* Navbar */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    margin-bottom: 30px;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-email {
    color: #666;
    font-size: 14px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-copy {
    padding: 8px 15px;
    font-size: 13px;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

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

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

.success-actions {
    margin-top: 15px;
}

/* Forms */
.auth-box,
.form-container {
    max-width: 500px;
    margin: 50px auto;
    padding: 40px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.form-hint {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
}

.auth-link a {
    color: #007bff;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Dashboard */
.main-content {
    min-height: calc(100vh - 200px);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.empty-state p {
    margin-bottom: 15px;
    color: #666;
}

/* Events Grid */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.event-card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.event-card h3 {
    margin-bottom: 10px;
    color: #333;
}

.event-description {
    color: #666;
    margin-bottom: 15px;
}

.event-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.stat {
    color: #007bff;
}

.stat-date {
    color: #999;
    font-size: 13px;
}

.event-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-link-group {
    display: flex;
    gap: 5px;
}

.share-link-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 12px;
    background-color: #f9f9f9;
}

/* Event Page */
.event-page,
.results-page {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.event-header,
.results-header {
    margin-bottom: 30px;
}

.event-info,
.results-info {
    padding: 15px;
    background-color: #f0f8ff;
    border-radius: 5px;
    margin: 20px 0;
}

/* Date Selector */
.date-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.date-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.selected-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.date-badge {
    display: inline-block;
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border-radius: 20px;
    font-size: 14px;
}

.selected-date-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background-color: #e7f3ff;
    border: 1px solid #007bff;
    border-radius: 5px;
    font-size: 14px;
}

.selected-date-item input[type="hidden"] {
    display: none;
}

.remove-date {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    padding: 0;
    line-height: 1;
}

.remove-date:hover {
    color: #a71d2a;
}

/* Results Page */
.results-section {
    margin: 30px 0;
}

.results-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.stats-table {
    overflow-x: auto;
}

.stats-table table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.stats-table th,
.stats-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.stats-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.best-date {
    background-color: #d4edda;
}

.date-cell {
    font-weight: 500;
}

.count-cell {
    color: #007bff;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    background-color: #28a745;
    color: white;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 10px;
}

.responses-list {
    display: grid;
    gap: 15px;
}

.response-card {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #007bff;
}

.response-card h3 {
    margin-bottom: 5px;
    color: #333;
}

.response-date {
    color: #999;
    font-size: 13px;
    margin-bottom: 15px;
}

.response-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.date-badge-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    position: relative;
}

.btn-delete-date {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    margin-left: -3px;
}

.btn-delete-date:hover {
    background-color: #c82333;
    transform: scale(1.1);
}

.btn-delete-date:active {
    transform: scale(0.95);
}

.results-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

/* Admin Controls */
.admin-notice {
    padding: 10px 15px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    color: #856404;
    font-size: 14px;
    margin-bottom: 20px;
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.btn-delete {
    padding: 6px 12px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-delete:hover {
    background-color: #c82333;
}

.btn-delete:active {
    transform: scale(0.95);
}

/* Homepage */
.hero {
    text-align: center;
    padding: 60px 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #333;
}

.hero p {
    font-size: 20px;
    color: #666;
    margin-bottom: 30px;
}

.hero-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Edit Mode */
.edit-mode-notice {
    padding: 10px 15px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    color: #856404;
    font-size: 14px;
    font-weight: 500;
    margin-top: 15px;
}

.edit-link-box {
    margin-top: 20px;
    padding: 15px;
    background-color: #f0f8ff;
    border: 1px solid #007bff;
    border-radius: 5px;
}

.edit-link-box p {
    margin-bottom: 10px;
}

/* Comments */
.response-comment {
    margin: 10px 0;
    padding: 10px;
    background-color: #f9f9f9;
    border-left: 3px solid #007bff;
    border-radius: 3px;
}

.response-comment strong {
    color: #007bff;
    display: block;
    margin-bottom: 5px;
}

.response-comment p {
    margin: 0;
    color: #555;
    font-size: 14px;
}

.updated-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    background-color: #ffc107;
    color: #000;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}

/* Calendar View */
.view-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.btn-view {
    padding: 10px 20px;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-view:hover {
    background-color: #e9ecef;
}

.btn-view.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
    font-size: 13px;
}

.legend-box {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 1px solid #ddd;
    margin-right: 5px;
    vertical-align: middle;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 30px;
}

.calendar-day {
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.calendar-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.calendar-day-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.calendar-day-date {
    font-size: 14px;
    font-weight: 500;
    color: #000;
    margin-bottom: 8px;
}

.calendar-day-count {
    font-size: 18px;
    font-weight: bold;
    color: #000;
}

/* Survey Options */
.survey-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.survey-option {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.survey-option:hover {
    background-color: #e9ecef;
    border-color: #007bff;
}

.survey-option input[type="radio"],
.survey-option input[type="checkbox"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.survey-option input[type="radio"]:checked ~ span,
.survey-option input[type="checkbox"]:checked ~ span {
    font-weight: 600;
    color: #007bff;
}

.survey-option input[type="radio"]:checked,
.survey-option input[type="checkbox"]:checked {
    accent-color: #007bff;
}

.survey-option span {
    font-size: 16px;
    color: #333;
}

/* Survey Results */
.survey-results-grid {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

.survey-result-item {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.survey-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.survey-result-option {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.survey-result-count {
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
}

.survey-result-bar {
    height: 30px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

.survey-result-fill {
    height: 100%;
    background: linear-gradient(to right, #007bff, #0056b3);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.survey-result-participants {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #007bff;
}

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

    .events-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .nav-content {
        flex-direction: column;
        gap: 10px;
    }

    .share-link-group {
        flex-direction: column;
    }

    .results-actions,
    .hero-actions,
    .form-actions {
        flex-direction: column;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero p {
        font-size: 16px;
    }

    .event-page,
    .results-page {
        padding: 20px;
    }

    .calendar-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .view-toggle {
        flex-direction: column;
    }

    .calendar-legend {
        font-size: 11px;
        gap: 8px;
    }
}
