/* Podcast Timer - Fullscreen Recording Interface */

:root {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --text-muted: #a3a3a3;
    --border-color: #404040;
    --primary-color: #22c55e;
    --primary-hover: #16a34a;
    --secondary-color: #6b7280;
    --secondary-hover: #4b5563;
    --danger-color: #ef4444;
    --recording-color: #ef4444;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --text-color: #171717;
    --text-muted: #525252;
    --border-color: #e5e5e5;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.podcast-timer-container {
    width: 100vw;
    height: 100vh;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
    overflow: hidden;
}

/* Header */
.timer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.timer-header h1 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 300;
    margin: 0;
    color: var(--text-color);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 8px;
    color: var(--text-color);
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.theme-select {
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1rem;
    cursor: pointer;
}

/* Main Timer Area */
.timer-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3rem;
    height: 100%;
    position: relative;
    padding-top: 2rem;
}

.podcast-timer-container.stacked-layout .timer-main {
    gap: 2rem;
    justify-content: flex-start;
    padding-top: 2rem;
}

/* Time Display */
.time-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
    flex: 1 1 auto;
    min-height: 30vh;
    max-height: 50vh;
    box-sizing: border-box;
}

.time-display.stacked {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-height: 70vh;
}

.current-time,
.elapsed-time {
    text-align: center;
    padding: 2rem;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    min-width: 0;
    transition: all 0.3s ease;
}

.current-time label,
.elapsed-time label {
    display: block;
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 500;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.recording-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--recording-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.recording-indicator.recording {
    opacity: 1;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.2);
    }
}

.time-value {
    font-size: clamp(3rem, 8vw, 8rem);
    font-weight: 200;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    letter-spacing: -2px;
    line-height: 0.9;
    white-space: nowrap;
    color: var(--text-color);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Controls */
.controls {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 2rem 0;
    flex-shrink: 0;
}

.btn {
    padding: 1.25rem 2.5rem;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 500;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    background-color: var(--secondary-color);
    color: white;
    border: 2px solid transparent;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn.primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn:not(.primary):hover:not(:disabled) {
    background-color: var(--secondary-hover);
    transform: translateY(-1px);
}

.btn-small {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

/* Markers Section */
.markers-section {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1000px;
    z-index: 100;
    transition: transform 0.3s ease;
}

.markers-section.collapsed {
    transform: translateX(-50%) translateY(calc(100% - 4rem));
}

.markers-section.collapsed .markers-list {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

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

.markers-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.markers-section.collapsed .markers-header {
    margin-bottom: 0;
}

.markers-list {
    margin-top: 0.5rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    height: 15vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    transition: max-height 0.3s ease, opacity 0.3s ease;
    color: var(--text-color);
}

.marker-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
}

.marker-item:last-child {
    border-bottom: none;
}

.marker-time {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-weight: 500;
}

.marker-delete {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    opacity: 0.6;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.marker-delete:hover {
    opacity: 1;
    background-color: var(--border-color);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: var(--bg-color);
    margin: 5% auto;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalOpen 0.3s ease-out;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

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

.modal-body {
    padding: 1.5rem;
    line-height: 1.6;
    color: var(--text-color);
}

.modal-body h3 {
    margin: 1rem 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
}

.modal-body ul {
    margin: 0.5rem 0 1rem 1.5rem;
    list-style: disc;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

.attribution {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

.attribution a {
    color: var(--primary-color);
    text-decoration: none;
}

.attribution a:hover {
    text-decoration: underline;
}

@keyframes modalOpen {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .time-display {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-height: 65vh;
    }
    
    .controls {
        gap: 1rem;
    }
    
    .btn {
        min-width: 120px;
        padding: 1rem 2rem;
    }
    
    .time-value {
        font-size: clamp(2rem, 12vw, 6rem);
    }
    
    .podcast-timer-container {
        padding: 1rem;
    }
}

@media (min-width: 1200px) {
    .time-value {
        font-size: clamp(4rem, 10vw, 12rem);
    }
}

/* High DPI displays */
@media (min-width: 1920px) {
    .time-value {
        font-size: clamp(6rem, 12vw, 16rem);
    }
}

/* Fullscreen mode optimizations */
@media (display-mode: fullscreen) {
    .podcast-timer-container {
        padding: 2rem;
    }
    
    .timer-header {
        margin-bottom: 2rem;
    }
    
    .timer-main {
        gap: 4rem;
    }
}