/* Base styles */
:root {
    --primary-color: #0d3a7a;
    --secondary-color: #f0f0f0;
    --accent-color: #2196F3;
    --text-color: #333;
    --light-text: #fff;
    --spacing-sm: 20px;
    --spacing-md: 30px;
    --spacing-lg: 40px;
    --border-radius: 8px;
}

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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f9f9f9;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header styles */
header {
    background-color: var(--primary-color);
    padding: 36px 0;
    margin-bottom: var(--spacing-sm);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: white;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-container {
    flex: 0 0 122px;
    background-color: white;
    border-radius: 4px;
    padding: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.school-info h1 {
    font-size: 0.8rem;
    margin-bottom: 3px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: normal;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.school-info h2 {
    font-size: 2.25rem;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 5px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.school-info h3 {
    font-size: 1.2rem;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Main content styles */
main {
    padding: var(--spacing-sm) 0;
}

.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Two column layout */
.two-column-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.left-column {
    flex: 0 0 60%;
}

.right-column {
    flex: 0 0 calc(40% - 20px);
}

.instructions-box, .controls {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Controls styles */
.controls {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    box-sizing: border-box;
}

.controls-container {
    background-color: #f0f0f0;
    border: 2px solid #000;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 1000px;
}

.controls-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.controls-row:last-child {
    margin-bottom: 0;
}

.checkbox-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.tempo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.tempo-input-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Button styles */
button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s, transform 0.1s;
}

button:hover {
    background-color: #0a2c5d;
}

button:active {
    transform: scale(0.98);
}

/* Make buttons consistent in size */
.controls-row button {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    position: relative;
}

.play-btn .play-icon {
    display: block;
}

.play-btn .stop-icon {
    display: none;
}

.play-btn.playing .play-icon {
    display: none;
}

.play-btn.playing .stop-icon {
    display: block;
}

.play-btn.loading .play-icon,
.play-btn.loading .stop-icon {
    display: none;
}

.loading-icon {
    font-size: 0.8rem;
}

/* Tempo controls */
.tempo-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.tempo-input {
    width: 60px;
    height: 30px;
    text-align: center;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.bpm-label {
    font-size: 0.8rem;
    color: #666;
    margin-left: 5px;
}

/* Checkbox styles */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-text {
    font-size: 0.9rem;
}

/* Grid styles */
.grid-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
    aspect-ratio: 1 / 1;
    transition: transform 1s ease;
}

.cell {
    background-color: white;
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s;
}

.cell:hover {
    background-color: #f0f0f0;
}

.icon-container {
    width: 70%;
    height: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s ease;
}

.icon {
    max-width: 100%;
    max-height: 100%;
    transition: transform 0.3s ease;
}

/* Rotation indicator */
.rotation-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

#rotation-arrow {
    animation: rotate 1s linear;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(90deg); }
}

/* Disabled state */
button:disabled,
.tempo-btn.disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Back button */
.back-button {
    display: inline-flex;
    align-items: center;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: 500;
    margin-bottom: 20px;
}

.back-button:hover {
    background-color: #0a2c5d;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .controls-row {
        flex-direction: column;
        align-items: center;
    }
    
    .checkbox-container {
        flex-direction: column;
        align-items: center;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .school-info h2 {
        font-size: 1.8rem;
    }
}