:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --danger-color: #ff4444;
    --background-color: #f5f7fa;
    --card-color: #ffffff;
    --text-color: #333333;
    --text-secondary: #666666;
    --text-muted: #888888;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

.container {
    max-width: 400px;
    width: 100%;
    background-color: var(--card-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

h1 {
    text-align: center;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.time-display {
    font-size: 3.5rem;
    font-weight: bold;
    text-align: center;
    color: var(--text-color);
    margin: 1.5rem 0;
    font-family: monospace;
}

.input-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.input-field {
    flex: 1;
    margin-right: 10px;
}

.input-field:last-child {
    margin-right: 0;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--text-muted);
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    height: 32px;
}

.input-group input[type="time"],
.input-group input[type="text"],
.input-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--text-muted);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--card-color);
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.input-group input[type="time"]:focus,
.input-group input[type="text"]:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.volume-control {
    margin: 1.5rem 0;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
    margin: 1rem 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-ms-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.weekdays {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.weekday-item {
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    border: 1px solid var(--text-muted);
    transition: all 0.2s ease;
}

.weekday-item.selected {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.weekday-item:hover {
    background-color: #e0e0e0;
}

button[type="submit"] {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 1rem;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

.preview-btn {
    background-color: var(--secondary-color);
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.alarm-list {
    margin-top: 2rem;
    opacity: 1 !important;
    visibility: visible !important;
}

.alarm-item {
    background-color: var(--card-color);
    padding: 1.2rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease;
    border: 1px solid var(--text-muted);
}

.alarm-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.alarm-modal-content {
    background-color: var(--card-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    animation: slideIn 0.3s ease;
    color: var(--text-color);
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.stop-alarm-btn {
    background-color: var(--danger-color);
    color: white;
}

.stop-alarm-btn:hover {
    background-color: darken(var(--danger-color), 10%);
    transform: translateY(-2px);
}

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

.snooze-btn:hover {
    background-color: darken(var(--secondary-color), 10%);
    transform: translateY(-2px);
}

.dark-mode {
    --background-color: #1a1a1a;
    --card-color: #2d2d2d;
    --text-color: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 1.5rem;
    }

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

    .weekdays {
        justify-content: center;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.remaining-time {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

.alarm-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.alarm-time {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-color);
}

.alarm-label {
    color: var(--text-secondary);
}

.alarm-days {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.dark-mode .alarm-label {
    color: #aaa;
}

.dark-mode .alarm-days {
    color: #999;
}

.dark-mode .remaining-time {
    color: var(--primary-color);
}

.alarm-controls {
    display: flex;
    gap: 10px;
}

.toggle-alarm,
.delete-alarm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    flex: 1;
}

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

.toggle-alarm:hover {
    background-color: darken(var(--secondary-color), 10%);
    transform: translateY(-2px);
}

.delete-alarm {
    background-color: var(--danger-color);
    color: white;
}

.delete-alarm:hover {
    background-color: darken(var(--danger-color), 10%);
    transform: translateY(-2px);
}

@media (max-width: 576px) {
    .alarm-item {
        flex-direction: column;
        gap: 1rem;
    }

    .alarm-controls {
        width: 100%;
        justify-content: space-between;
    }
}

.toggle-alarm.active {
    background-color: var(--secondary-color);
    color: white;
}

.toggle-alarm:not(.active) {
    background-color: var(--text-muted);
    color: white;
}

.delete-alarm {
    background-color: var(--danger-color);
    color: white;
}

.alarm-controls button {
    min-width: 120px;
    transition: all 0.3s ease;
}

.alarm-controls button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.alarm-item {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-footer {
    margin-top: 3rem;
    padding: 2rem 0;
    background-color: var(--card-color);
    border-top: 1px solid var(--text-muted);
    margin-bottom: -20px;
    margin-left: -20px;
    margin-right: -20px;
    width: calc(100% + 40px);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 0 20px;
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (min-width: 500px) {
    .container {
        max-width: 800px;
    }
}

.dark-mode .container {
    background-color: var(--card-color);
}

.dark-mode input[type="time"],
.dark-mode input[type="text"],
.dark-mode select {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

.sound-selection {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.sound-selection select {
    max-width: 300px;
    width: 100%;
    margin-bottom: 0;
    color: var(--text-color);
    background-color: var(--card-color);
}


.sound-selection select option {
    /* (This rule is overridden below for consistency and specificity) */
}

/* Ensure dropdown text is always visible */
.sound-selection select,
.sound-selection select option {
    color: var(--text-color) !important;
    -webkit-text-fill-color: var(--text-color) !important;
}

@media (max-width: 576px) {
    .sound-selection {
        flex-direction: column;
        align-items: stretch;
    }

    .sound-selection select {
        max-width: 100%;
    }

    .preview-btn {
        width: 100%;
    }
}

.input-row {
    display: flex;
    gap: 20px;
    margin-bottom: 1.5rem;
}

.input-field {
    flex: 1;
}

.input-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-field input {
    width: 80%;
    padding: 0.8rem;
    border: 2px solid var(--text-muted);
    border-radius: 8px;
    font-size: 1rem;
}

@media (max-width: 576px) {
    .input-row {
        flex-direction: column;
        gap: 1rem;
    }
}

input,
select,
button {
    opacity: 1 !important;
    visibility: visible !important;
}

.input-field input {
    height: 2px;
}

.pomodoro-container {
    margin-top: 3rem;
    background-color: var(--card-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.pomodoro-container h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

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

.pomodoro-settings label {
    margin-right: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.pomodoro-settings input {
    width: 60px;
    padding: 0.4rem;
    border: 2px solid var(--text-muted);
    border-radius: 6px;
}

#pomodoro-timer {
    font-size: 3rem;
    font-weight: bold;
    margin: 1rem 0;
}

.pomodoro-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.pomodoro-controls button {
    padding: 0.8rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    background-color: var(--primary-color);
    color: white;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.pomodoro-controls button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pomodoro-controls button:hover:not(:disabled) {
    transform: translateY(-2px);
}

/* Odak Modu Modal Stilleri */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: var(--card-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 600px;
    width: 90%;
    text-align: center;
}

#close-focus {
    margin-top: 1rem;
    background: var(--secondary-color);
    color: #fff;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
}

.focus-btn {
    display: block;
    margin: 1.5rem auto 0;
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

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

/* Yan yana düzen: Alarm ve Pomodoro */
.dual-column {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
}

.container,
#pomodoro-wrapper {
    flex: 1 1 300px;
    max-width: 500px;
}


/* İki container arasına mesafe ekle */
.container+.container {
    margin-top: 2rem;
}