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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 300;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen {
    display: none;
    width: 100%;
    text-align: center;
}

.screen.active {
    display: block;
}

.device-container {
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
}

.device-icon {
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.device-icon.large {
    width: 140px;
    height: 140px;
}

.device-icon circle {
    transition: fill 0.3s ease;
}

.device-icon.off circle {
    fill: #666;
    transition: fill 0.5s ease;
}

.device-icon.on circle {
    fill: #ffd700;
    filter: brightness(1.2);
    transition: fill 0.5s ease;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.device-icon.success circle {
    fill: #4CAF50;
}

.device-icon.off rect {
    fill: #666;
    transition: fill 0.5s ease;
}

.device-icon.on rect {
    fill: #ffd700;
    transition: fill 0.5s ease;
}

.device-icon.success rect {
    fill: #4CAF50;
}

.info-card, .instruction-card, .completion-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.info-card h2, .instruction-card h2, .completion-card h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.6em;
}

.reset-methods {
    margin: 20px 0;
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr 1fr;
}

.method-card {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.method-card:hover {
    border-color: #4CAF50;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.method-card h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
    text-align: center;
}

.method-overview {
    margin-bottom: 20px;
    flex-grow: 1;
}

.method-overview p {
    margin-bottom: 15px;
    color: #666;
    font-size: 0.9em;
}

.method-overview ul {
    list-style: none;
    padding: 0;
}

.method-overview li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    font-size: 0.9em;
}

.method-overview li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
}

.primary-btn.secondary {
    background: #2196F3;
    margin-top: auto;
}

.primary-btn.secondary:hover {
    background: #1976D2;
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.method-card .primary-btn {
    margin-top: auto;
}

.primary-btn, .secondary-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
    font-weight: 500;
}

.primary-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.secondary-btn {
    background: #6c757d;
    margin-top: 10px;
}

.secondary-btn:hover {
    background: #5a6268;
}

.progress-header {
    margin-bottom: 20px;
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.cycle-counter {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 4px;
}

.instruction-card {
    text-align: center;
}

.instruction-card p {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 20px;
}

.timer-container {
    margin: 20px 0;
}

.timer-circle {
    position: relative;
    display: inline-block;
}

.timer-circle svg {
    transform: rotate(-90deg);
}

.timer-progress {
    transition: stroke-dashoffset 1s linear;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8em;
    font-weight: bold;
    color: #4CAF50;
}

.timer-label {
    margin-top: 15px;
    color: #666;
    font-size: 0.9em;
}

.toggle-counter {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.toggle-counter h3 {
    margin-bottom: 12px;
    color: #333;
    font-size: 1.1em;
}

.toggle-progress {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: #555;
}

.toggle-dots {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ddd;
    transition: background 0.3s ease;
}

.dot.completed {
    background: #4CAF50;
}

.success-animation {
    margin-bottom: 30px;
}

.success-animation .device-icon {
    animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.ap-info {
    background: #e8f5e8;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.ap-info h3 {
    margin-bottom: 15px;
    color: #2e7d32;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 0;
}

.detail-row strong {
    color: #333;
    min-width: 100px;
}

.detail-row code {
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    color: #d63384;
}

.next-steps {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

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

.next-steps ol {
    text-align: left;
    padding-left: 20px;
}

.next-steps li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Device Selection Styles */
.device-selection {
    text-align: center;
    margin-bottom: 30px;
}

.device-selection-header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.device-selection-header h2 {
    font-size: 2em;
    margin-bottom: 10px;
}

.device-list {
    margin-bottom: 30px;
}

.device-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s ease;
}

.device-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.device-icon {
    flex-shrink: 0;
}

.device-info {
    flex-grow: 1;
}

.device-info h3 {
    margin: 0 0 5px 0;
    color: #333;
}

.device-description {
    margin: 0 0 5px 0;
    color: #666;
    font-size: 14px;
}

.device-firmware {
    margin: 0;
    color: #999;
    font-size: 12px;
}

.select-device-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.select-device-btn:hover {
    background: #45a049;
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px 20px;
    background: linear-gradient(90deg, #e3f2fd, #f3e5f5);
    border-radius: 25px;
    border: 2px solid #e0e0e0;
}

.status-text {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

.status-pulse {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 2s infinite;
}

.status-indicator.waiting .status-pulse {
    background: #ff9800;
}

.status-indicator.toggling .status-pulse {
    background: #2196f3;
    animation: pulse 0.5s infinite;
}

/* Animations */
@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.device-icon.flashing circle,
.device-icon.flashing rect {
    animation: flash 0.5s infinite;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.2);
        opacity: 0.7;
    }
}

@keyframes deviceGlow {
    0%, 100% { 
        filter: brightness(1.2) drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
    }
    50% { 
        filter: brightness(1.5) drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    }
}

.device-icon.on {
    animation: deviceGlow 1s ease-in-out;
}

.device-icon.off {
    animation: none;
}

/* Hero Section */
.hero-section {
    margin-bottom: 40px;
    text-align: center;
    color: white;
}

.hero-content h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    font-weight: 300;
}

.hero-description {
    font-size: 1.2em;
    margin-bottom: 30px;
    opacity: 0.9;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-icon {
    font-size: 2em;
}

.feature span:last-child {
    font-size: 0.9em;
    font-weight: 500;
}

/* Footer */
footer {
    margin-top: 60px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    color: white;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 600;
}

.footer-section p {
    line-height: 1.6;
    opacity: 0.9;
    font-size: 0.95em;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.8;
    font-size: 0.9em;
}

.footer-links {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: white;
}

/* Responsive adjustments for hero and footer */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .info-card, .instruction-card, .completion-card {
        padding: 15px;
        margin: 0 5px;
    }
    
    .info-card h2, .instruction-card h2, .completion-card h2 {
        font-size: 1.4em;
        margin-bottom: 12px;
    }
    
    .reset-methods {
        grid-template-columns: 1fr;
    }
    
    .device-icon.large {
        width: 120px;
        height: 120px;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .detail-row strong {
        min-width: auto;
    }

    .device-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .device-icon {
        width: 80px;
        height: 80px;
    }

    .hero-content h2 {
        font-size: 2em;
    }
    
    .hero-description {
        font-size: 1.1em;
        padding: 0 20px;
    }
    
    .hero-features {
        gap: 20px;
    }
    
    .feature {
        padding: 12px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    footer {
        margin-top: 40px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.6em;
    }
    
    .info-card, .instruction-card, .completion-card {
        padding: 12px;
    }
    
    .info-card h2, .instruction-card h2, .completion-card h2 {
        font-size: 1.2em;
        margin-bottom: 10px;
    }
    
    .device-icon.large {
        width: 100px;
        height: 100px;
    }
    
    .toggle-dots {
        gap: 8px;
    }
    
    .dot {
        width: 12px;
        height: 12px;
    }
    
    .timer-container {
        margin: 15px 0;
    }
    
    .timer-text {
        font-size: 1.5em;
    }
    
    .timer-label {
        font-size: 0.8em;
        margin-top: 10px;
    }
    
    .progress-header {
        margin-bottom: 15px;
        padding: 12px;
    }
    
    .cycle-counter {
        font-size: 1em;
        margin-bottom: 8px;
    }

    .hero-content h2 {
        font-size: 1.8em;
    }
    
    .hero-features {
        flex-direction: column;
        align-items: center;
    }
    
    .feature {
        width: 100%;
        max-width: 200px;
    }
}

/* Device Filters */
.device-filters {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-container {
    position: relative;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    background: white;
    color: #333;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.search-input::placeholder {
    color: #999;
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    color: #666;
    pointer-events: none;
}

.category-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-weight: 500;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: #4CAF50;
    border-color: #4CAF50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.no-results {
    text-align: center;
    color: white;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    margin-bottom: 20px;
}

.no-results p {
    margin-bottom: 20px;
    font-size: 1.1em;
    opacity: 0.9;
}

/* Responsive adjustments for filters */
@media (max-width: 768px) {
    .device-filters {
        padding: 15px;
    }
    
    .category-filters {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .category-filters {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Selected Method Styles */
.method-card.selected {
    border: 2px solid #4CAF50;
    background: linear-gradient(135deg, #f8fff8 0%, #f0fff0 100%);
    position: relative;
}

.selected-method-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.selected-badge {
    background: #4CAF50;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.begin-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.begin-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 15px;
    font-weight: 500;
}

.begin-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    display: block;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.begin-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.change-method-btn {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.change-method-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

@media (max-width: 768px) {
    .begin-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .change-method-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .selected-method-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}
