:root {
    --active-bg: #ff4444;
    --active-text: #ffffff;
    --active-circle: #ffffff;
    --rest-bg: #44ff44;
    --rest-text: #000000;
    --rest-circle: #000000;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #1a1a1a;
    color: #ffffff;
    transition: background-color 0.3s ease;
    padding: 20px;
}

body.obs-mode {
    background: transparent !important;
}

body.obs-mode .about-section {
    display: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    min-height: 100vh;
}

.container.settings-collapsed {
    padding-top: 100px;
}

.settings-panel {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 10px;
    min-width: 300px;
    max-width: 380px;
    width: 380px;
    transition: all 0.5s ease;
    position: absolute;
    left: 20px;
    top: 20px;
}

.settings-collapsed .settings-panel {
    top: 20px;
    left: 20px;
    /* transform: translateX(-50%); */
}

.settings-panel.collapsed {
    padding: 10px 20px;
}

.timer-view {
    margin-left: 420px;
    transition: all 0.5s ease;
}

.settings-collapsed .timer-view {
    margin-left: 0;
}

.settings-panel.hidden {
    display: none;
}

.settings-panel.collapsed .settings-content {
    display: none;
}

.settings-panel.collapsed h1 {
    margin-bottom: 0;
}

h1 {
    margin-bottom: 15px;
    font-size: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 5px 0;
}

.collapse-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.settings-panel.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.settings-content {
    transition: all 0.3s ease;
}

.form-group {
    margin-bottom: 12px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 500;
}

input[type="number"],
select {
    width: 100%;
    padding: 8px;
    border: 2px solid #ccc;
    border-radius: 5px;
    background: #ccc;
    color: #000;
    font-size: 13px;
}

input[type="color"] {
    width: 100%;
    height: 32px;
    border: 1px solid #444;
    border-radius: 5px;
    cursor: pointer;
    background: #1a1a1a;
}

.toggle-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.toggle-btn {
    flex: 1;
    padding: 8px 6px;
    border: 2px solid #444;
    border-radius: 5px;
    background: #1a1a1a;
    color: #888;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.toggle-btn.active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.toggle-btn:hover {
    opacity: 0.8;
}

.toggle-icon {
    font-size: 16px;
}

.time-inputs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.time-inputs .form-group {
    margin-bottom: 0;
}

.color-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.color-picker-wrapper {
    position: relative;
    height: 50px;
}

.color-picker-wrapper input[type="color"] {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    padding: 0;
    background: none;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 5px;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 5px;
}

.color-picker-wrapper input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 5px;
}

.color-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 700;
    pointer-events: none;
    text-shadow: 0 0 3px rgba(0,0,0,0.5);
    letter-spacing: 0.5px;
}

.button-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

button {
    flex: 1;
    padding: 9px;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.8;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-secondary {
    background: #2196F3;
    color: white;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-copy {
    width: 100%;
    background: #FF9800;
    color: white;
    margin-top: 12px;
}

.timer-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    position: relative;
    max-width: 600px;
    margin-left: 420px;
    transition: all 0.5s ease;
}

.settings-collapsed .timer-view {
    max-width: 100%;
    margin-left: 0;
}

.timer-container {
    position: relative;
    width: 90vmin;
    height: 90vmin;
    max-width: 500px;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.circle-progress {
    fill: none;
    stroke: var(--circle-color);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke 0.3s ease, opacity 0.3s ease;
}

.timer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 1;
}

.timer-time {
    font-size: 15vmin;
    font-weight: 700;
    color: var(--text-color);
    transition: color 0.3s ease;
    line-height: 1;
    margin-bottom: 2vmin;
}

.timer-phase {
    font-size: 4vmin;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.8;
    transition: color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5vmin;
    margin-bottom: 1vmin;
}

.timer-phase.hidden {
    display: none;
}

.timer-reps {
    font-size: 3vmin;
    color: var(--text-color);
    opacity: 0.6;
    transition: color 0.3s ease;
}

.timer-reps.hidden {
    display: none;
}

.timer-controls {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

.timer-controls.hidden {
    display: none;
}

.timer-controls button {
    min-width: 100px;
}

.theme-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.theme-controls button {
    flex: 1;
}

.copy-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1000;
}

.copy-feedback.show {
    opacity: 1;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: #2a2a2a;
    padding: 25px;
    border-radius: 10px;
    min-width: 300px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    margin: 0 0 15px 0;
    font-size: 18px;
    text-align: center;
}

.modal-content input[type="text"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #444;
    border-radius: 5px;
    background: #1a1a1a;
    color: #ffffff;
    font-size: 14px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-buttons button {
    flex: 1;
}

/* About Section */
.about-section {
    width: 100%;
    max-width: 1200px;
    background: #2a2a2a;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.about-section.hidden {
    display: none;
}

.about-section h2 {
    margin: 0 0 15px 0;
    font-size: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 5px 0;
}

.about-section.collapsed .about-content {
    display: none;
}

.about-section.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.about-content {
    line-height: 1.6;
    transition: all 0.3s ease;
}

.about-content h3 {
    color: #4CAF50;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 18px;
}

.about-content h3:first-child {
    margin-top: 0;
}

.about-content p {
    margin-bottom: 15px;
    color: #ccc;
}

.about-content ul,
.about-content ol {
    margin-bottom: 15px;
    padding-left: 25px;
    color: #ccc;
}

.about-content li {
    margin-bottom: 8px;
}

.about-content strong {
    color: #fff;
}

.about-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #444;
    font-style: italic;
    color: #888;
    text-align: center;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding-top: 20px;
    }
    .container.settings-collapsed {
        padding-top: 20px;
    }


    .settings-panel {
        position: static;
        width: 100%;
        max-width: 100%;
        left: auto;
        top: auto;
        transform: none;
    }

    .settings-collapsed .settings-panel {
        position: static;
        transform: none;
        left: auto;
    }

    .timer-view {
        margin-left: 0;
        max-width: 100%;
    }

    .settings-collapsed .timer-view {
        margin-left: 0;
    }

    .timer-container {
        width: 90vmin;
        height: 90vmin;
        max-width: 100%;
        max-height: 90vmin;
    }
}