:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --background: #0f0f23;
    --surface: #1a1a2e;
    --surface-light: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --border-color: #27272a;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-light: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

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

.title {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.2); }
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    opacity: 0;
    animation: fadeInUp 1s ease 0.5s forwards;
}

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

.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    grid-auto-rows: minmax(200px, auto);
}

.bento-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
}

.bento-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.bento-card:hover::before {
    transform: translateX(100%);
}

.card-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Profile Card */
.profile-card {
    background: var(--gradient-1);
    color: white;
}

.avatar {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

.avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease;
}

.profile-card:hover .avatar img {
    transform: scale(1.1);
}

.status-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: var(--success);
    border-radius: 50%;
    border: 3px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.profile-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.profile-info p {
    opacity: 0.8;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links i {
    font-size: 1.2rem;
    opacity: 0.7;
    transition: all 0.3s ease;
    cursor: pointer;
}

.social-links i:hover {
    opacity: 1;
    transform: translateY(-2px);
}

/* Weather Card */
.weather-card {
    background: var(--gradient-3);
    color: white;
    position: relative;
}

.weather-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

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

.temperature {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.location {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.condition {
    opacity: 0.8;
    margin-bottom: 1rem;
}

.weather-details {
    display: flex;
    gap: 1rem;
}

.detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.8;
}

.weather-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.weather-particles::before,
.weather-particles::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: sparkle 2s linear infinite;
}

.weather-particles::before {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.weather-particles::after {
    top: 60%;
    right: 30%;
    animation-delay: 1s;
}

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

/* Music Card */
.music-card {
    background: var(--gradient-2);
    color: white;
}

.album-art {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 1rem;
    border-radius: 15px;
    overflow: hidden;
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.music-card:hover .album-art img {
    transform: scale(1.1);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.music-card:hover .play-button {
    opacity: 1;
}

.track-info h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.track-info p {
    opacity: 0.8;
    margin-bottom: 1rem;
}

.music-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: white;
    width: 60%;
    border-radius: 2px;
    animation: progress 3s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 60%; }
    50% { width: 75%; }
    100% { width: 60%; }
}

.music-visualizer {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    gap: 3px;
    align-items: end;
}

.bar {
    width: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
    animation: visualizer 1s ease-in-out infinite;
}

.bar:nth-child(1) { height: 20px; animation-delay: 0s; }
.bar:nth-child(2) { height: 15px; animation-delay: 0.1s; }
.bar:nth-child(3) { height: 25px; animation-delay: 0.2s; }
.bar:nth-child(4) { height: 18px; animation-delay: 0.3s; }
.bar:nth-child(5) { height: 22px; animation-delay: 0.4s; }

@keyframes visualizer {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.3); }
}

/* Stats Card */
.stats-card h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.chart-container {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toggle Card */
.toggle-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.toggle-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.toggle-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.toggle-switch {
    margin-bottom: 1rem;
}

.toggle-input {
    display: none;
}

.toggle-label {
    display: block;
    width: 60px;
    height: 30px;
    background: var(--border-color);
    border-radius: 15px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked + .toggle-label {
    background: var(--primary-color);
}

.toggle-input:checked + .toggle-label .toggle-slider {
    transform: translateX(30px);
}

.toggle-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Notification Card */
.notification-card {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.notification-icon {
    position: relative;
    display: inline-block;
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: bell 2s ease-in-out infinite;
}

@keyframes bell {
    0%, 50%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--warning);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.notification-content h3 {
    margin-bottom: 1rem;
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.notification-dot {
    width: 8px;
    height: 8px;
    background: var(--warning);
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Calendar Card */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-header h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.calendar-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--surface-light);
    color: var(--primary-color);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-day.header {
    color: var(--text-secondary);
    font-weight: bold;
    cursor: default;
}

.calendar-day:not(.header):hover {
    background: var(--surface-light);
    color: var(--primary-color);
}

.calendar-day.today {
    background: var(--primary-color);
    color: white;
    font-weight: bold;
}

/* Battery Card */
.battery-card {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
    position: relative;
}

.battery-icon {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.battery-body {
    width: 80px;
    height: 40px;
    border: 3px solid white;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.battery-level {
    height: 100%;
    background: white;
    width: 87%;
    border-radius: 4px;
    animation: batteryPulse 2s ease-in-out infinite;
}

@keyframes batteryPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.battery-tip {
    width: 6px;
    height: 20px;
    background: white;
    border-radius: 0 3px 3px 0;
    margin-left: 2px;
}

.battery-percentage {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.battery-status {
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.battery-time {
    opacity: 0.8;
    font-size: 0.9rem;
}

.charging-animation {
    position: absolute;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    font-size: 1.5rem;
    animation: charging 1.5s ease-in-out infinite;
}

.charging-animation::before {
    content: '⚡';
}

@keyframes charging {
    0%, 100% { opacity: 0.5; transform: translateY(-50%) scale(1); }
    50% { opacity: 1; transform: translateY(-50%) scale(1.2); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .bento-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states */
.bento-card:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.control-btn:focus-visible,
.nav-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}