:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #10b981;
    --success-dark: #059669;
    --warning: #f59e0b;
    --error: #ef4444;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #e2e8f0;
    --text: #1e293b;
    --text-light: #64748b;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --border-radius: 12px;
}

/* Reset and base styles */
.web-crypto-demo-page {
    scroll-behavior: smooth;
}

.web-crypto-demo-container {
    max-width: min(900px, 95vw);
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: var(--text);
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
}

.skip-link:focus {
    top: 6px;
}

/* Typography */
.page-header h1 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    text-align: center;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    color: var(--dark);
}

.subtitle {
    text-align: center;
    font-size: clamp(1rem, 3vw, 1.2rem);
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.breadcrumb ol {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb li:not(:last-child)::after {
    content: "›";
    margin-left: 0.5rem;
    color: var(--text-light);
}

/* Cards and sections */
.card {
    background: var(--light);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--gray);
}

.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-item {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    position: relative;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Forms and inputs */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.input-group textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid var(--gray);
    border-radius: 8px;
    font-family: monospace;
    resize: vertical;
    transition: var(--transition);
}

.input-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.help-text {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Buttons */
.crypto-btn, .copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.crypto-btn {
    background: var(--success);
    color: white;
}

.crypto-btn:hover {
    background: var(--success-dark);
    transform: translateY(-1px);
}

.copy-btn {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Results */
.result-area {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--gray);
}

.code {
    background: var(--dark);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Alerts and notifications */
.security-badge, .warning {
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
}

.security-badge {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-left: 4px solid var(--primary);
}

.warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

/* FAQ Section */
.faq-section details {
    margin-bottom: 1rem;
    border: 1px solid var(--gray);
    border-radius: 8px;
}

.faq-section summary {
    padding: 1rem;
    cursor: pointer;
    font-weight: 600;
}

.faq-section div {
    padding: 1rem;
    border-top: 1px solid var(--gray);
}

/* Loading states */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 8px;
    margin: 1rem 0;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .web-crypto-demo-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .features-list {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .web-crypto-demo-container {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .card {
        padding: 1rem;
    }
}

/* Print styles */
@media print {
    .web-crypto-demo-container {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
    
    .crypto-btn, .copy-btn {
        display: none;
    }
}