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

:root {
    --bg-primary: #0f0c29;
    --bg-secondary: #1a163a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --accent-blue: #667eea;
    --accent-purple: #764ba2;
    --accent-pink: #f093fb;
    --accent-cyan: #4facfe;
    --accent-green: #43e97b;
    --accent-red: #ff6b6b;
    --accent-orange: #ffa726;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    --glow-blue: 0 0 20px rgba(102, 126, 234, 0.3);
    --glow-purple: 0 0 20px rgba(118, 75, 162, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a163a 50%, #0f0c29 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(79, 172, 254, 0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 50%, var(--accent-pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.status-bar {
    display: flex;
    gap: 1.5rem;
}

.status {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.status .connected {
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(67, 233, 123, 0.5);
}

.status .disconnected {
    color: var(--accent-red);
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

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

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .dashboard {
        padding: 1rem;
    }
}

.card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--glow-blue);
    border-color: rgba(255, 255, 255, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-content {
    padding: 1.5rem;
    min-height: 400px;
}

.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    border: none;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.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: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.placeholder {
    text-align: center;
    color: var(--text-secondary);
    padding: 4rem 2rem;
}

.placeholder p {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.placeholder .hint {
    font-size: 0.8rem;
    margin-top: 1rem;
    opacity: 0.6;
    font-style: italic;
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem;
    position: relative;
}

.loading::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 1rem auto;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.error {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15) 0%, rgba(255, 107, 107, 0.05) 100%);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    color: var(--accent-red);
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.2);
}

/* Email List Styles */
.email-list {
    list-style: none;
}

.email-item {
    display: grid;
    grid-template-columns: 200px 1fr 100px;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    margin: 0 -0.5rem;
}

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

.email-item:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.05) 100%);
    transform: translateX(4px);
}

.email-sender {
    font-weight: 600;
    color: var(--accent-cyan);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(79, 172, 254, 0.3);
}

.email-subject {
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-date {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-align: right;
    white-space: nowrap;
}

.email-snippet {
    grid-column: 2 / 4;
    color: var(--text-secondary);
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 1rem;
    opacity: 0.8;
}

.email-headers {
    display: grid;
    grid-template-columns: 200px 1fr 100px;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.05) 100%);
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px 8px 0 0;
    margin: -1.5rem -1.5rem 1rem -1.5rem;
}

/* Weather Styles */
.weather-current {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

.weather-temp {
    font-size: 4rem;
    font-weight: 200;
    line-height: 1;
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(102, 126, 234, 0.5);
    letter-spacing: -2px;
}

.weather-condition {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-top: 0.75rem;
    font-weight: 500;
    opacity: 0.9;
}

.weather-details {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.weather-detail {
    text-align: center;
    position: relative;
}

.weather-detail::before {
    content: '';
    position: absolute;
    top: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
}

.weather-detail-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.weather-detail-value {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 0.375rem;
    color: var(--text-primary);
}

.weather-forecast {
    margin-top: 1.5rem;
}

.weather-forecast h3 {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
    text-align: center;
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.forecast-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    padding: 1rem 0.75rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.forecast-item:hover {
    transform: translateY(-4px);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.forecast-day {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.forecast-temp {
    font-size: 1.125rem;
    font-weight: 600;
}

.forecast-temp-high {
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.forecast-temp-low {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

footer {
    margin-top: 3rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 2rem;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

footer p {
    opacity: 0.8;
}

/* Weather Settings Panel */
.settings-panel {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 20px 20px;
}

.settings-panel h3 {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.setting-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.setting-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.setting-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.setting-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

.setting-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    opacity: 0.7;
    font-style: italic;
}

.setting-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

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

.hidden {
    display: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-pink) 100%);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

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

.card {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.email-item {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.email-item:nth-child(1) { animation-delay: 0.05s; }
.email-item:nth-child(2) { animation-delay: 0.1s; }
.email-item:nth-child(3) { animation-delay: 0.15s; }
.email-item:nth-child(4) { animation-delay: 0.2s; }
.email-item:nth-child(5) { animation-delay: 0.25s; }
.email-item:nth-child(6) { animation-delay: 0.3s; }

.forecast-item {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.forecast-item:nth-child(1) { animation-delay: 0.1s; }
.forecast-item:nth-child(2) { animation-delay: 0.2s; }
.forecast-item:nth-child(3) { animation-delay: 0.3s; }
.forecast-item:nth-child(4) { animation-delay: 0.4s; }

/* Selection */
::selection {
    background: rgba(102, 126, 234, 0.4);
    color: white;
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.4);
    color: white;
}
