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

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #00ff88 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

h2 {
    color: #444;
    margin-bottom: 20px;
    font-size: 28px;
}

h3 {
    color: #555;
    margin-bottom: 15px;
}

/* Navigation Bar */
.navbar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.nav-btn {
    padding: 12px 35px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    cursor: pointer;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: #f0f0ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

.nav-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Content Sections */
.content-section {
    display: none;
    animation: fadeIn 0.4s ease-in;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Home Section Styles */
.intro-content {
    line-height: 1.8;
}

.intro-content p {
    margin-bottom: 15px;
    color: #555;
}

.intro-content ul {
    list-style: none;
    margin: 20px 0;
}

.intro-content ul li {
    padding: 10px 0;
    padding-left: 25px;
    position: relative;
    color: #555;
}

.intro-content ul li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
    font-size: 18px;
}

.getting-started {
    background: #f8f9ff;
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    border-left: 4px solid #667eea;
}

.getting-started h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.getting-started ol {
    margin-left: 20px;
    color: #555;
}

.getting-started ol li {
    margin: 10px 0;
    line-height: 1.6;
}

.info-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.info-box p {
    margin: 0;
    color: #856404;
}

/* Guide Section Styles */
.guide-content {
    line-height: 1.8;
}

.guide-intro {
    background: #e8f5e9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #4CAF50;
}

.guide-intro p {
    margin: 0;
    color: #2e7d32;
}

.notation-guide {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.notation-guide ul {
    list-style: none;
    margin-left: 0;
}

.notation-guide ul li {
    padding: 8px 0;
    color: #555;
}

.layer-steps {
    margin-top: 30px;
}

.step-placeholder {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.step-placeholder:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.step-placeholder h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 18px;
}

.placeholder-text {
    color: #999;
    font-style: italic;
    margin: 0;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.mode-btn {
    padding: 10px 30px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    cursor: pointer;
    border-radius: 5px;
    font-size: 16px;
    transition: all 0.3s;
}

.mode-btn.active {
    background: #667eea;
    color: white;
}

.mode-btn:hover {
    transform: scale(1.05);
}

/* 2D Display */
.display-2d {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.cube-2d {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.face-row {
    display: flex;
    gap: 5px;
}

.face {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 2px;
    width: 150px;
    height: 150px;
    padding: 5px;
    background: #333;
    border-radius: 5px;
}

.face-spacer {
    width: 150px;
    height: 150px;
}

.sticker {
    border: 1px solid #333;
    cursor: pointer;
    transition: transform 0.1s;
}

.sticker:hover {
    transform: scale(1.1);
}

/* 3D Display */
.display-3d {
    perspective: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.cube-3d-container {
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
    user-select: none;
}

.cube-3d-container:active {
    cursor: grabbing;
}

.cube-3d {
    width: 200px;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-20deg) rotateY(-30deg);
    transition: transform 0.1s ease-out;
}

.drag-info {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
    font-style: italic;
}

.cube-face {
    position: absolute;
    width: 200px;
    height: 200px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 2px;
    padding: 5px;
    background: #333;
}

.cube-front  { transform: translateZ(100px); }
.cube-back   { transform: translateZ(-100px) rotateY(180deg); }
.cube-right  { transform: rotateY(90deg) translateZ(100px); }
.cube-left   { transform: rotateY(-90deg) translateZ(100px); }
.cube-top    { transform: rotateX(90deg) translateZ(100px); }
.cube-bottom { transform: rotateX(-90deg) translateZ(100px); }

/* Controls */
.controls {
    margin-bottom: 30px;
}

.move-buttons {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.move-btn {
    padding: 15px;
    border: 2px solid #333;
    background: #f0f0f0;
    cursor: pointer;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s;
}

.move-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.move-btn:active {
    transform: translateY(0);
}

/* Manual Input */
.manual-input {
    margin-bottom: 30px;
}

.manual-input p {
    color: #666;
    margin-bottom: 10px;
}

.color-palette {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.color-btn {
    width: 50px;
    height: 50px;
    border: 3px solid #333;
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.2s;
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.selected {
    border: 3px solid #667eea;
    box-shadow: 0 0 10px #667eea;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 15px 30px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

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

.action-btn.solve:hover {
    background: #45a049;
}

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

.action-btn.reset:hover {
    background: #da190b;
}

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

.action-btn.apply:hover {
    background: #0b7dda;
}

.action-btn.scramble {
    background: #FF9800;
    color: white;
}

.action-btn.scramble:hover {
    background: #F57C00;
}

.action-btn.apply-solution {
    background: #9C27B0;
    color: white;
    margin-top: 15px;
}

.action-btn.apply-solution:hover {
    background: #7B1FA2;
}

.action-btn.apply-solution:disabled {
    background: #9E9E9E;
    cursor: not-allowed;
}

/* Solution Display */
.solution {
    background: #f0f0f0;
    padding: 20px;
    border-radius: 5px;
    margin-top: 20px;
}

.solution h3 {
    margin-bottom: 10px;
}

#solutionInfo {
    line-height: 1.6;
}

#solutionInfo p {
    margin-bottom: 10px;
}

.moves-display {
    background: white;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
    font-family: monospace;
    word-wrap: break-word;
}

/* Color classes */
.color-U { background: white; }
.color-R { background: red; }
.color-F { background: green; }
.color-D { background: yellow; }
.color-L { background: orange; }
.color-B { background: blue; }

/* Responsive */
@media (max-width: 768px) {
    .move-buttons {
        grid-template-columns: repeat(4, 1fr);
    }

    .face {
        width: 100px;
        height: 100px;
    }

    .face-spacer {
        width: 100px;
        height: 100px;
    }
}
