:root {
    --primary-color: #007AFF;
    --background-color: #F5F5F7;
    --card-background: #FFFFFF;
    --text-color: #1D1D1F;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --success-color: #34C759;
    --selected-background: #F0F7FF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1rem;
    color: #86868B;
}

.device-selection {
    margin-bottom: 2rem;
}

.device-selection h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    padding: 0 1rem;
}

.hint {
    color: #86868B;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    padding: 0 1rem;
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    padding: 0.5rem;
}

.device-card {
    background: var(--card-background);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px var(--shadow-color);
    position: relative;
    border: 2px solid transparent;
    user-select: none;
    touch-action: manipulation;
}

.device-card:active {
    transform: scale(0.95);
}

.device-card:hover {
    box-shadow: 0 4px 8px var(--shadow-color);
}

.device-card.selected {
    border-color: var(--primary-color);
    background-color: var(--selected-background);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.device-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 0.75rem;
    fill: var(--primary-color);
    transition: transform 0.2s ease;
}

.device-card.selected .device-icon {
    transform: scale(1.1);
}

.device-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.selected-mark {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.device-card.selected .selected-mark {
    display: flex;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    0% {
        transform: scale(0);
    }
    70% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.solution-section {
    text-align: center;
    margin: 2rem 0;
    padding: 0 1rem;
}

.primary-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.2);
}

.primary-button:not(:disabled):hover {
    background: #0056D6;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 122, 255, 0.3);
}

.primary-button:not(:disabled):active {
    transform: translateY(0);
}

.primary-button:disabled {
    background: #B0B0B0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    position: relative;
    background: var(--card-background);
    margin: 5% auto;
    padding: 1.5rem;
    width: 90%;
    max-width: 800px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.close-button {
    position: absolute;
    right: 1.25rem;
    top: 1.25rem;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    background: #F0F0F0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.close-button:hover {
    background: #E0E0E0;
    color: #333;
}

#solution-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    padding-right: 2rem;
}

#solution-content {
    font-size: 1rem;
    line-height: 1.6;
}

.solution-step {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #F8F8F8;
    border-radius: 12px;
}

.solution-step h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.solution-step p {
    margin-bottom: 1rem;
    color: #666;
}

.solution-step ol {
    padding-left: 1.25rem;
}

.solution-step li {
    margin-bottom: 0.5rem;
}

.solution-step li:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.75rem;
    }
    
    .device-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    
    .device-card {
        padding: 0.75rem;
    }
    
    .device-icon {
        width: 40px;
        height: 40px;
    }
    
    .device-card h3 {
        font-size: 0.9rem;
    }
    
    .modal-content {
        margin: 0;
        min-height: 100vh;
        border-radius: 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    header {
        padding: 0.75rem;
    }
    
    .device-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }
} 