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

:root {
    --primary-color: #667eea;
    --primary-dark: #5a6fd8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #4ade80;
    --warning-color: #fbbf24;
    --error-color: #ef4444;
    --love-color: #ff69b4;
    --anniversary-color: #ffd700;
    --holiday-color: #ff6b6b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --background: #f8fafc;
    --card-background: #ffffff;
    --border-color: #e5e7eb;
    --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-large: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    --gradient-love: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%);
    --gradient-anniversary: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
}

body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--gradient-primary);
    opacity: 0.05;
}

.background-animation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23667eea" fill-opacity="0.1"><circle cx="7" cy="7" r="7"/></g></svg>') repeat;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.header {
    background: var(--gradient-primary);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: var(--shadow-large);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

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

.login-container {
    max-width: 400px;
    margin: 2rem auto;
    background: var(--card-background);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-large);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

input, select, textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-with-icon {
    padding-left: 2.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    width: 100%;
}

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

.btn-secondary {
    background: var(--gradient-accent);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--error-color), #dc2626);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #16a34a);
    color: white;
}

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

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

.event-container {
    display: none;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: var(--card-background);
    border-radius: 15px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-medium);
    overflow-x: auto;
    gap: 0.25rem;
}

.tab-button {
    flex: 1;
    min-width: 140px;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.tab-button.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-medium);
}

.tab-button:hover:not(.active) {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

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

.stat-card {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

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

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.card {
    background: var(--card-background);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

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

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
}

.dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .dashboard {
        grid-template-columns: 2fr 1fr;
    }
}

.event-form {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .event-form {
        grid-template-columns: 1fr 1fr;
    }
}

.event-list {
    max-height: 500px;
    overflow-y: auto;
}

.event-item {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.event-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
}

.event-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-medium);
}

.event-info {
    flex: 1;
}

.event-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.event-date {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.event-countdown {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-weight: 500;
    display: inline-block;
}

.countdown-upcoming {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.countdown-soon {
    background: rgba(251, 191, 36, 0.1);
    color: #f59e0b;
}

.countdown-overdue {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.event-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.5rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

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

.counter-card {
    background: var(--card-background);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.counter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.love-counter::before {
    background: var(--gradient-love);
}

.anniversary-counter::before {
    background: var(--gradient-anniversary);
}

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

.counter-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.counter-label {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.love-counter .counter-number {
    background: var(--gradient-love);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.anniversary-counter .counter-number {
    background: var(--gradient-anniversary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.holiday-item {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.holiday-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(238, 90, 36, 0.1));
}

.holiday-date {
    font-weight: 600;
    color: var(--holiday-color);
    margin-bottom: 0.5rem;
}

.holiday-name {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.holiday-countdown {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.logout-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.notification {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
}

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

.notification.error {
    background: var(--error-color);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.anniversary-note {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.anniversary-item::before {
    background: var(--gradient-anniversary);
}

.calculator-result {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    color: var(--primary-color);
    font-weight: 500;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .tab-navigation {
        flex-wrap: wrap;
    }
    
    .tab-button {
        min-width: auto;
        flex: 1 1 calc(50% - 0.25rem);
    }
    
    .event-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .event-actions {
        align-self: stretch;
        justify-content: flex-end;
    }
    
    .counter-grid {
        grid-template-columns: 1fr;
    }
}