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

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border: #334155;
    --success: #10b981;
    --warning: #f59e0b;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.1) 0px, transparent 50%);
}

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

header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

header h1 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

#current-time {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

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

.card {
    background: var(--surface);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px var(--shadow);
}

.card h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--background);
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    border: 1px solid var(--border);
    cursor: pointer;
    min-height: 90px;
}

.link-item:hover {
    background: var(--surface-hover);
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.link-item span {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.link-item p {
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-secondary);
}

/* Weather Card */
.weather-card {
    grid-column: span 1;
}

.weather-input {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.weather-input input {
    flex: 1;
    padding: 0.75rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.weather-input button,
.add-button {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.weather-input button:hover,
.add-button:hover {
    background: var(--secondary-color);
}

.add-button {
    width: 100%;
    margin-top: 0.75rem;
    background: var(--background);
    color: var(--primary-color);
    border: 1px dashed var(--primary-color);
}

.add-button:hover {
    background: var(--surface-hover);
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

#weather-info {
    background: var(--background);
    padding: 1.5rem;
    border-radius: 0.75rem;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.weather-data {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.temperature {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
}

.weather-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

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

.loading {
    text-align: center;
    color: var(--text-secondary);
}

.error {
    color: var(--warning);
    text-align: center;
}

/* Ham Radio Card */
.freq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.freq-item {
    background: var(--background);
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    text-align: center;
}

.freq-band {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.freq-range {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.freq-note {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
}

footer p {
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

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

    .links-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .card {
        padding: 1rem;
    }
}

/* Camera card specific styling */
.cameras-card {
    grid-column: span 1;
}

/* Larger cards can span more columns on wider screens */
@media (min-width: 1024px) {
    .weather-card {
        grid-column: span 1;
    }

    .news-card,
    .quick-links-card {
        grid-column: span 1;
    }
}
