:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --text-color-rgb: 0, 0, 0;
    --button-bg: #f0f0f0;
    --button-hover: #e0e0e0;
    --logo-filter: invert(0);
    --transition-speed: 0.3s;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --text-color: #ffffff;
        --text-color-rgb: 255, 255, 255;
        --button-bg: #333333;
        --button-hover: #444444;
    }
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --text-color: #000000;
    --text-color-rgb: 0, 0, 0;
    --button-bg: #f0f0f0;
    --button-hover: #e0e0e0;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #ffffff;
    --text-color-rgb: 255, 255, 255;
    --button-bg: #333333;
    --button-hover: #444444;
    --logo-filter: invert(1);
}

[data-theme="space"] {
    --bg-color: #030314;
    --text-color: #ffffff;
    --text-color-rgb: 255, 255, 255;
    --button-bg: #1a1a47;
    --button-hover: #252560;
    --logo-filter: invert(1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@keyframes twinkle {
    0% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0.2; transform: scale(0.8); }
}

.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    display: none;
    will-change: transform;
    content-visibility: auto;
}

[data-theme="space"] .stars {
    display: block;
    background: linear-gradient(180deg, #030314 0%, #04052a 100%);
}

.star {
    position: absolute;
    width: 1px;
    height: 1px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 0 2px 1px rgba(255, 255, 255, 0.6);
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.star.medium {
    width: 2px;
    height: 2px;
    box-shadow: 0 0 3px 1px rgba(255, 255, 255, 0.7);
}

.star.big {
    width: 3px;
    height: 3px;
    box-shadow: 0 0 4px 1px rgba(255, 255, 255, 0.8);
}

.star.twinkle {
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0.2; transform: scale(0.8); }
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    min-height: -webkit-fill-available; /* iOS Safari için */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    overflow-x: hidden;
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior: none;
}

html {
    height: -webkit-fill-available; /* iOS Safari için */
}

.header {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-end;
    z-index: 100;
}

.theme-switch {
    display: flex;
    gap: 0.5rem;
}

.theme-switch button,
.language-switch button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.2s;
}

.theme-switch button:hover,
.language-switch button:hover {
    transform: scale(1.1);
}

.theme-switch button:active,
.language-switch button:active {
    transform: scale(0.95);
}

.language-switch {
    display: flex;
    gap: 0.5rem;
}

.language-switch button {
    font-size: 1rem;
    background-color: var(--button-bg);
    border-radius: 4px;
    padding: 0.3rem 0.8rem;
    transition: background-color 0.2s, transform 0.2s;
}

.container {
    max-width: 600px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    margin-top: -100px;
    padding-top: 100px;
}

.timer-container {
    text-align: center;
    margin: 2rem 0;
}

.timer {
    font-size: clamp(5rem, 15vw, 10rem);
    font-weight: 600;
    will-change: contents;
}

.motivation {
    font-size: 1.2rem;
    margin: 1rem 0;
    text-align: center;
    color: var(--text-color);
    opacity: 1;
    transition: all var(--transition-speed) ease;
    font-weight: 500;
}

[data-theme='dark'] .motivation {
    color: var(--text-color);
}

.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    background-color: var(--button-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    -webkit-transition: background-color 0.2s, -webkit-transform 0.2s;
    font-family: inherit;
    font-weight: 500;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(1px);
}

.laps-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.laps-container h2 {
    margin-bottom: 1rem;
}

#lapsList {
    list-style: none;
}

.lap-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid var(--button-bg);
}

.lap-item input {
    width: 200px;
    padding: 0.5rem;
    border: 1px solid var(--button-bg);
    border-radius: 4px;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.delete-lap {
    cursor: pointer;
    color: #ff4444;
}

.site-title {
    position: fixed;
    top: 1rem;
    left: 1rem;
    font-size: 3rem;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
    z-index: 100;
    font-family: 'Poppins', sans-serif;
}

@media (max-width: 600px) {
    body {
        padding: 0.5rem;
        min-height: 100vh;
        display: flex;
        align-items: center;
    }

    .header {
        top: 0.5rem;
        right: 0.5rem;
    }

    .container {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin-top: -50px;
    }

    .timer-container {
        margin: 1rem 0;
    }

    .timer {
        font-size: 8rem;
    }

    .motivation {
        font-size: 1rem;
        margin: 0.5rem 0;
    }
    
    .controls {
        flex-wrap: wrap;
        gap: 0.8rem;
        justify-content: center;
        width: 100%;
        max-width: 400px;
        margin: 2rem auto;
    }
    
    button {
        flex: 1 1 40%;
        padding: 1rem;
        font-size: 1rem;
        min-width: 120px;
    }

    .lap-item {
        flex-direction: row;
        gap: 1rem;
        padding: 1rem;
        align-items: center;
    }

    .lap-item input {
        width: 150px;
    }

    .language-switch {
        margin-top: 0.5rem;
    }

    .language-switch button {
        padding: 0.4rem 0.8rem;
        font-size: 1rem;
    }

    .site-title {
        font-size: 2rem;
        top: 0.5rem;
        left: 0.5rem;
    }
}

@media (max-width: 768px) {
    .motivation {
        font-size: 1rem;
        margin: 0.5rem 0;
    }
} 