/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    color: #e0e0e0;
}

/* Main app container */
#app {
    width: 100%;
    max-width: 600px;
    height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    outline: none;
    position: relative;
    overflow: hidden;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

header h1 {
    font-size: 1.8rem;
    color: #fff;
    font-weight: 600;
}

/* Main content area */
main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Controls */
#controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

#controls button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #4a9eff;
    color: #fff;
}

#controls button:hover {
    background: #3a8eef;
    transform: translateY(-2px);
}

#controls button:active {
    transform: translateY(0);
}

#controls button:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
}

/* Action list container */
#action-list-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

#action-list-container h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #aaa;
    font-weight: 500;
}

/* Action list */
#action-list {
    list-style: none;
    counter-reset: action-counter;
}

#action-list li {
    counter-increment: action-counter;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#action-list li::before {
    content: counter(action-counter);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 0.8rem;
    flex-shrink: 0;
}

#action-list li.active {
    background: rgba(74, 158, 255, 0.2);
    border-left-color: #4a9eff;
}

#action-list li.active::before {
    background: #4a9eff;
    color: #fff;
}

#action-list li.completed {
    opacity: 0.5;
}

/* Action type icons */
.action-icon {
    font-size: 1.2rem;
}

.action-details {
    flex: 1;
    min-width: 0;
}

.action-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-info {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.25rem;
}

/* Playing indicator */
#action-list li.playing {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(74, 158, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(74, 158, 255, 0);
    }
}

/* Status message */
#status {
    text-align: center;
    margin-top: 1rem;
    padding: 0.5rem;
    font-size: 0.9rem;
    color: #888;
}

/* Keyboard hint */
.keyboard-hint {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: #666;
}

.keyboard-hint kbd {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-family: inherit;
    margin: 0 0.25rem;
}

/* Custom Scrollbar */
#action-list-container::-webkit-scrollbar {
    width: 8px;
}

#action-list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

#action-list-container::-webkit-scrollbar-thumb {
    background: rgba(74, 158, 255, 0.4);
    border-radius: 4px;
    transition: background 0.2s ease;
}

#action-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 158, 255, 0.6);
}

/* Firefox scrollbar */
#action-list-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(74, 158, 255, 0.4) rgba(255, 255, 255, 0.05);
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 1rem;
    }

    #app {
        padding: 1.5rem;
    }

    header h1 {
        font-size: 1.4rem;
    }

    #controls button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}
