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

:root {
    --primary-color: #4a90a4;
    --primary-hover: #3d7a8c;
    --secondary-color: #6c757d;
    --secondary-hover: #5a6268;
    --alert-color: #e74c3c;
    --success-color: #27ae60;
    --background: #f5f7fa;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --text-muted: #7f8c8d;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--background);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
header {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), #5ba3b8);
    color: white;
    position: relative;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    opacity: 0.9;
    font-size: 1rem;
}

.back-link {
    position: absolute;
    left: 1rem;
    top: 1rem;
    color: white;
    text-decoration: none;
    opacity: 0.9;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
}

/* Main */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
}

main.tool-page {
    max-width: 500px;
}

/* Search */
.search-container {
    margin-bottom: 1.5rem;
}

#search-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: var(--card-bg);
    transition: border-color 0.2s;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

#search-input::placeholder {
    color: var(--text-muted);
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Tool Card */
.tool-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tool-card h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.tool-description {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Tool Link Card */
.tool-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tool-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.tool-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.tool-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--background);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* No Results */
.no-results {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* Timer Specific Styles */
.timer-display {
    font-size: 4rem;
    font-weight: 300;
    text-align: center;
    padding: 1.5rem;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s ease;
}

.timer-display.alert {
    color: var(--alert-color);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

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

/* Buttons */
.btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

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

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

.btn-primary.running {
    background-color: var(--alert-color);
}

.btn-primary.running:hover {
    background-color: #c0392b;
}

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

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-large {
    padding: 1rem 3rem;
    font-size: 1.125rem;
}

/* Timer Settings */
.timer-settings {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.timer-settings label {
    font-weight: 500;
}

#interval-slider {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
    cursor: pointer;
}

#interval-input {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 1rem;
}

#interval-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Notification Status */
.notification-status {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    min-height: 1.5rem;
}

.notification-status.warning {
    color: var(--alert-color);
}

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

/* Responsive */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .back-link {
        position: static;
        display: block;
        margin-bottom: 0.5rem;
    }

    .timer-display {
        font-size: 3rem;
    }

    .tool-card {
        padding: 1.25rem;
    }

    .timer-settings {
        flex-direction: column;
    }

    #interval-slider {
        width: 100%;
        max-width: none;
    }

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