/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --christmas-red: #c41e3a;
    --christmas-green: #0f7d3c;
    --christmas-gold: #d4af37;
    --snow-white: #ffffff;
    --winter-blue: #4a90e2;
    --dark-green: #0a5028;
    --light-bg: #f8f9fa;
    --text-dark: #2c3e50;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Animazione Fiocchi di Neve */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10%;
    color: white;
    font-size: 1.5em;
    opacity: 0.8;
    animation: fall linear infinite;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

@keyframes fall {
    to {
        transform: translateY(105vh);
    }
}

.snowflake:nth-child(1) { left: 10%; animation-duration: 10s; animation-delay: 0s; }
.snowflake:nth-child(2) { left: 20%; animation-duration: 12s; animation-delay: 2s; }
.snowflake:nth-child(3) { left: 30%; animation-duration: 9s; animation-delay: 4s; }
.snowflake:nth-child(4) { left: 40%; animation-duration: 11s; animation-delay: 1s; }
.snowflake:nth-child(5) { left: 50%; animation-duration: 13s; animation-delay: 3s; }
.snowflake:nth-child(6) { left: 60%; animation-duration: 10s; animation-delay: 5s; }
.snowflake:nth-child(7) { left: 70%; animation-duration: 12s; animation-delay: 2s; }
.snowflake:nth-child(8) { left: 80%; animation-duration: 11s; animation-delay: 4s; }
.snowflake:nth-child(9) { left: 90%; animation-duration: 9s; animation-delay: 1s; }
.snowflake:nth-child(10) { left: 95%; animation-duration: 13s; animation-delay: 3s; }

/* Container Base */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 2;
}

/* === LANDING PAGE === */
.landing-page {
    background: linear-gradient(135deg, #0f7d3c 0%, #c41e3a 100%);
}

.hero {
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 40px;
}

.hero-title {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 3.5em;
    color: var(--snow-white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.hero-subtitle {
    font-size: 1.3em;
    color: var(--snow-white);
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.emoji {
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1em;
    box-shadow: var(--shadow);
}

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

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

.btn-secondary {
    background: var(--snow-white);
    color: var(--christmas-green);
}

.btn-secondary:hover {
    background: var(--light-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-large {
    padding: 16px 40px;
    font-size: 1.2em;
}

.btn-block {
    width: 100%;
    text-align: center;
}

/* Features Section */
.features, .benefits, .final-cta {
    margin: 60px 0;
}

.section-title {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 2.5em;
    color: var(--snow-white);
    text-align: center;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

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

.feature-card {
    background: var(--snow-white);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.feature-card h3 {
    color: var(--christmas-green);
    margin-bottom: 10px;
    font-size: 1.4em;
}

.feature-card p {
    color: var(--text-dark);
}

/* Benefits */
.benefits-list {
    background: var(--snow-white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--light-bg);
}

.benefit-item:last-child {
    border-bottom: none;
}

.benefit-icon {
    font-size: 1.5em;
    color: var(--christmas-green);
}

.benefit-item p {
    font-size: 1.1em;
    color: var(--text-dark);
}

/* Final CTA */
.final-cta {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 60px 40px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.final-cta h2 {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 2.5em;
    color: var(--snow-white);
    margin-bottom: 15px;
}

.final-cta p {
    font-size: 1.2em;
    color: var(--snow-white);
    margin-bottom: 30px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--snow-white);
    font-size: 0.9em;
}

/* === AUTH PAGES === */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 2;
}

.auth-card {
    background: var(--snow-white);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-hover);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 2.5em;
    color: var(--christmas-green);
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--text-dark);
    font-size: 1.1em;
}

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

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

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

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--light-bg);
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--christmas-green);
    box-shadow: 0 0 0 3px rgba(15, 125, 60, 0.1);
}

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

.auth-footer p {
    margin: 10px 0;
}

.auth-footer a {
    color: var(--christmas-red);
    text-decoration: none;
    font-weight: 600;
}

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

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

.alert-error {
    background: #fee;
    color: #c00;
    border: 2px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #0a5028;
    border: 2px solid #cfc;
}

/* === DASHBOARD === */
.dashboard-page {
    background: linear-gradient(135deg, #0f7d3c 0%, #4a90e2 100%);
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 2;
}

.dashboard-header {
    background: var(--snow-white);
    border-radius: 15px;
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-content h1 {
    font-family: 'Mountains of Christmas', cursive;
    color: var(--christmas-green);
    font-size: 2.2em;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.user-email {
    color: var(--text-dark);
    font-weight: 500;
}

.dashboard-content {
    position: relative;
    z-index: 2;
}

.create-calendar-section {
    text-align: center;
    margin: 40px 0;
}

/* Empty State */
.empty-state {
    background: var(--snow-white);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 5em;
    margin-bottom: 20px;
}

.empty-state h2 {
    font-family: 'Mountains of Christmas', cursive;
    color: var(--christmas-green);
    font-size: 2em;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 1.2em;
    color: var(--text-dark);
    margin-bottom: 30px;
}

/* Calendar Grid */
.calendars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.calendar-card {
    background: var(--snow-white);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

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

.calendar-card-header {
    margin-bottom: 15px;
    border-bottom: 2px solid var(--light-bg);
    padding-bottom: 15px;
}

.calendar-card-header h3 {
    color: var(--christmas-green);
    font-size: 1.5em;
    margin-bottom: 5px;
}

.calendar-date {
    color: #777;
    font-size: 0.9em;
}

.calendar-description {
    color: var(--text-dark);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Calendar Stats */
.calendar-stats {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 10px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.stat-icon {
    font-size: 1.8em;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--christmas-red);
}

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

/* Calendar Actions */
.calendar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn-sm {
    padding: 8px 15px;
    font-size: 0.9em;
    flex: 1;
    min-width: 100px;
    text-align: center;
}

.btn-view {
    background: var(--winter-blue);
    color: var(--snow-white);
}

.btn-view:hover {
    background: #3a7bc8;
}

.btn-edit {
    background: var(--christmas-gold);
    color: var(--text-dark);
}

.btn-edit:hover {
    background: #c49f2d;
}

.btn-share {
    background: var(--christmas-green);
    color: var(--snow-white);
}

.btn-share:hover {
    background: var(--dark-green);
}

.btn-delete {
    background: var(--christmas-red);
    color: var(--snow-white);
}

.btn-delete:hover {
    background: #a01729;
}

.btn-admin {
    background: #764ba2;
    color: var(--snow-white);
}

.btn-admin:hover {
    background: #5f3c82;
}

.btn-builder {
    background: #ff6b6b;
    color: var(--snow-white);
}

.btn-builder:hover {
    background: #ee5a52;
}

.btn-preview {
    background: #17a2b8;
    color: var(--snow-white);
}

.btn-preview:hover {
    background: #138496;
}

/* Share Section in Calendar Card */
.share-section {
    display: flex;
    gap: 5px;
    width: 100%;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.share-link-input {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.8em;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    color: #666;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-link-input:focus {
    outline: none;
    border-color: var(--christmas-green);
    background: white;
}

.share-section .btn-share {
    flex-shrink: 0;
    min-width: auto;
    padding: 8px 15px;
}

/* === ADMIN PAGE === */
.admin-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 2;
}

.admin-header {
    background: var(--snow-white);
    border-radius: 15px;
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.admin-content {
    position: relative;
    z-index: 2;
}

.stats-section {
    margin-bottom: 40px;
}

.stats-section h2 {
    font-family: 'Mountains of Christmas', cursive;
    color: var(--snow-white);
    font-size: 2em;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--snow-white);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

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

.stat-card .stat-icon {
    font-size: 3em;
}

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-card .stat-value {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--christmas-red);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 1em;
    color: #666;
    margin-top: 5px;
}

/* Admin Sections */
.section {
    background: var(--snow-white);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.section h2 {
    font-family: 'Mountains of Christmas', cursive;
    color: var(--christmas-green);
    font-size: 1.8em;
    margin-bottom: 20px;
}

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

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead {
    background: var(--christmas-green);
    color: var(--snow-white);
}

.admin-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.admin-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--light-bg);
}

.admin-table tbody tr:hover {
    background: var(--light-bg);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5em;
    }

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

    .section-title {
        font-size: 2em;
    }

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

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

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .calendar-actions {
        flex-direction: column;
    }

    .btn-sm {
        width: 100%;
    }

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

    .admin-table {
        font-size: 0.9em;
    }

    .admin-table th,
    .admin-table td {
        padding: 10px;
    }
}
