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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Page Management */
.page {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.page.active {
    display: block;
}

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

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 3rem;
    color: #333;
}

.logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 1rem;
    border-radius: 10px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #e9ecef;
    color: #333;
    border: 2px solid #dee2e6;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    cursor: pointer;
    font-size: 1rem;
}

.back-button:hover {
    background: #dee2e6;
    transform: translateY(-2px);
}

/* Distro Selection Page */
.distro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.distro-card {
    background: white;
    border: none;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.distro-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #007bff;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.distro-card:hover::before {
    transform: scaleX(1);
}

.distro-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
}

.pm-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.distro-card h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.distro-card p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.distro-note {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
    line-height: 1.3;
}

/* OS Selection Page */
.os-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.os-card {
    background: white;
    border: none;
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.os-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: #007bff;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.os-card:hover::before {
    transform: scaleX(1);
}

.os-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.os-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.os-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    border-radius: 10px;
    object-fit: contain;
}

.bsd-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.bsd-note {
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
}

.bsd-icon {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    object-fit: contain;
}

.os-card h3 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.os-card p {
    color: #666;
    font-size: 1rem;
}

/* Instructions Page */
#instructions-content {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Step Widget */
.step-widget {
    margin-bottom: 3rem;
    position: relative;
    padding-left: 4rem;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.step-widget.active {
    opacity: 1;
}

.step-widget.completed {
    opacity: 0.7;
}

.step-number {
    position: absolute;
    left: 0;
    top: 0;
    width: 3rem;
    height: 3rem;
    background: #007bff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
}

.step-widget.completed .step-number {
    background: #28a745;
}

.step-widget.active .step-number {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.step-content h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1rem;
    font-weight: 600;
}

.step-content p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.step-content code {
    background: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.step-content pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.popup-overlay.active {
    display: flex;
}

.popup-content {
    background: white;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}

.popup-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.3rem;
}

.popup-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.popup-close:hover {
    background: #e9ecef;
    color: #333;
}

.popup-body {
    padding: 1.5rem;
}

.popup-body p {
    margin-bottom: 1rem;
    color: #666;
    line-height: 1.6;
}

.command-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.command-box code {
    display: block;
    background: #2d3748;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-all;
    margin-top: 0.5rem;
}

.popup-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

/* Flash Effect */
.flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    pointer-events: none;
}

.flash-overlay.active {
    display: flex;
    animation: flashFade 2s ease-out forwards;
}

@keyframes flashFade {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.flash-image {
    max-width: 300px;
    max-height: 300px;
    object-fit: contain;
}

/* Installation Options */
.installation-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.option-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.option-card:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1);
}

.option-card h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.option-card pre {
    margin: 1rem 0;
    font-size: 0.85rem;
}

.option-card p {
    color: #666;
    font-size: 0.9rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .installation-options {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Navigation Buttons */
.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    bottom: 2rem;
    margin-top: 2rem;
    padding: 1.5rem 2rem;
    background: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid #dee2e6;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.nav-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-button:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.nav-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.nav-button.prev {
    background: #6c757d;
}

.nav-button.prev:hover {
    background: #545b62;
}

.step-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.progress-dots {
    display: flex;
    gap: 0.5rem;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dee2e6;
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: #007bff;
    transform: scale(1.2);
}

.progress-dot.completed {
    background: #28a745;
}

/* Tip Widget */
.tip-widget {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
    color: white;
}

.tip-widget::before {
    content: '💡';
    position: absolute;
    top: -15px;
    left: 2rem;
    font-size: 2rem;
    background: white;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.tip-widget h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.tip-widget p {
    line-height: 1.8;
    opacity: 0.95;
}

.tip-widget ul {
    margin-left: 1.5rem;
    margin-top: 1rem;
}

.tip-widget li {
    margin-bottom: 0.5rem;
    opacity: 0.95;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
}

.footer-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .os-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .distro-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .os-card {
        padding: 2rem;
    }
    
    .distro-card {
        padding: 1.5rem;
    }
    
    #instructions-content {
        padding: 2rem 1.5rem;
    }
    
    .step-widget {
        padding-left: 3.5rem;
    }
    
    .step-number {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .os-card {
        padding: 1.5rem;
    }
    
    .distro-card {
        padding: 1rem;
    }
    
    .os-icon {
        font-size: 3rem;
    }
    
    .pm-icon {
        font-size: 2.5rem;
    }
    
    #instructions-content {
        padding: 1.5rem 1rem;
    }
    
    .step-widget {
        padding-left: 3rem;
    }
    
    .step-number {
        width: 2rem;
        height: 2rem;
        font-size: 0.9rem;
    }
}
