/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--grid-border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.4rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.setting-item {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.setting-item.checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 1.5rem;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

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

.btn.secondary {
    background: #e0e0e0;
    color: #333;
}

/* Modern Action Buttons */
/* Modern Action Buttons */
.action-buttons button {
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    /* Pill shape */
    font-weight: 700;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    color: #333333;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 120px;
}

.action-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.action-buttons button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-buttons button.secondary {
    background: linear-gradient(135deg, var(--primary-color), #7c4dff);
    color: #fff;
    box-shadow: 0 4px 15px rgba(98, 0, 234, 0.3);
}

.action-buttons button.secondary:hover {
    box-shadow: 0 6px 20px rgba(98, 0, 234, 0.4);
}

.action-buttons button.outline {
    background: transparent;
    border: 2px solid #ff5252;
    color: #ff5252;
    box-shadow: none;
}

.action-buttons button.outline:hover {
    background: #ffebee;
    border-color: #ff1744;
    color: #ff1744;
}

/* Header Icon Buttons */
.icon-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text-color);
    opacity: 0.8;
}

.icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
    transform: rotate(15deg);
}

/* Clock Widget Styles */
.widget {
    font-size: 0.95rem;
    color: var(--text-color);
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.widget-date {
    font-weight: 400;
    opacity: 0.8;
}

/* 3D Digital Clock */
.digital-clock {
    background: #4A90E2;
    /* Blue casing */
    padding: 6px 8px;
    border-radius: 8px;
    position: relative;
    box-shadow:
        4px 4px 0 #2c5aa0,
        /* 3D depth */
        0 4px 6px rgba(0, 0, 0, 0.2);
    /* Drop shadow */
    margin: 0 8px 4px 8px;
    /* Space for shadow */
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    height: auto;
}

/* Screen */
.widget-time {
    background: #2b3a42;
    /* Dark screen */
    color: #e0f7fa !important;
    /* Light numbers always */
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 2px;
    padding: 2px 8px;
    border-radius: 4px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.4);
    line-height: 1;
    margin: 0;
}

/* Buttons on top */
.digital-clock::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 10px;
    width: 12px;
    height: 3px;
    background: #FFC107;
    /* Yellow button */
    border-radius: 3px 3px 0 0;
    box-shadow: 16px 0 0 #FFC107;
    /* Second button */
}

/* Feet */
.digital-clock::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 8px;
    width: 8px;
    height: 3px;
    background: #2c5aa0;
    /* Dark blue feet matching shadow */
    box-shadow: 42px 0 0 #2c5aa0;
    /* Right foot approx pos */
    z-index: -1;
    border-radius: 0 0 2px 2px;
}

/* Day Mode Specifics: Restore other overrides but keep clock 3D */
@media (prefers-color-scheme: light) {
    /* ... other day mode styles ... */
}