* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #c41e3a;
    --secondary-color: #2d5016;
    --background-color: #f5f5f5;
    --card-background: #ffffff;
    --text-color: #333333;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --error-color: #dc3545;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-color);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-background);
    border-radius: 20px;
    box-shadow: var(--shadow-hover);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b1538 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

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

.subtitle {
    font-size: 1.1em;
    opacity: 0.95;
}

main {
    padding: 40px 30px;
}

section {
    margin-bottom: 30px;
}

h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5em;
}

.instruction {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95em;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    flex: 1;
    min-width: 150px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #a01a2f;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.results-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
}

#resultsContainer {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.result-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid var(--primary-color);
}

.result-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
}

.result-card .person {
    font-weight: 600;
    font-size: 1.1em;
    color: var(--text-color);
}

.result-card .arrow {
    color: var(--primary-color);
    font-size: 1.5em;
    margin: 0 20px;
}

.result-card .target {
    font-weight: 600;
    font-size: 1.1em;
    color: var(--secondary-color);
    background: #e8f5e9;
    padding: 8px 15px;
    border-radius: 5px;
}

.error-section {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.error-section p {
    color: #856404;
    font-weight: 500;
}

.hidden {
    display: none;
}

footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #666;
    border-top: 1px solid var(--border-color);
}

/* Form Styles */
.form-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

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

.success-section {
    background: #d4edda;
    border: 2px solid var(--success-color);
    border-radius: 10px;
    padding: 25px;
    margin-top: 20px;
    text-align: center;
}

.success-message h2 {
    color: var(--success-color);
    margin-bottom: 15px;
}

.success-message .info {
    margin-top: 15px;
    font-style: italic;
    color: #666;
}

.info-section {
    background: #e7f3ff;
    border: 2px solid #2196F3;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.info-section h3 {
    color: #2196F3;
    margin-bottom: 10px;
}

.info-section p {
    margin-bottom: 10px;
    color: #333;
}

/* Admin Styles */
.stats-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.stat-card {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.stat-number {
    font-size: 3em;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1.1em;
    color: #666;
}

.partecipanti-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.partecipanti-list {
    margin-top: 20px;
    display: grid;
    gap: 10px;
}

.partecipante-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--primary-color);
}

.partecipante-info {
    flex: 1;
}

.partecipante-nome {
    font-weight: 600;
    font-size: 1.1em;
    color: var(--text-color);
}

.partecipante-email {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

.actions-section {
    display: grid;
    gap: 20px;
}

.action-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
}

.action-card.warning {
    border-color: var(--error-color);
    background: #fff5f5;
}

.action-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.action-card.warning h3 {
    color: var(--error-color);
}

.action-card p {
    color: #666;
    margin-bottom: 15px;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.email-results-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    margin-top: 20px;
}

.email-result-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.email-result-item.success {
    border-left: 4px solid var(--success-color);
}

.email-result-item.error {
    border-left: 4px solid var(--error-color);
}

@media (max-width: 600px) {
    header h1 {
        font-size: 2em;
    }

    main {
        padding: 30px 20px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .result-card {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .result-card .arrow {
        transform: rotate(90deg);
        margin: 5px 0;
    }

    .partecipante-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

