/* Modern CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #2c3e50;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Domain Info Section */
.domain-info {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%);
    backdrop-filter: blur(20px);
    padding: 40px 30px;
    margin: 20px 0 30px 0;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.3);
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    animation: fadeIn 0.8s ease-out;
    position: relative;
    overflow: hidden;
}

.domain-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="black" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.3;
}

.domain-info h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

.domain-info p {
    font-size: 1.2rem;
    color: #34495e;
    margin-bottom: 20px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.domain-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.stat {
    background: rgba(39, 174, 96, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.2);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Category Headers */
.category-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 15px 25px;
    margin: 30px 0 15px 0;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(44, 62, 80, 0.3);
    position: relative;
    overflow: hidden;
}

.category-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Test Sections */
.test-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 25px;
    margin: 20px 0;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    animation: fadeIn 0.6s ease-out;
}

.test-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Modern Button Styling */
.button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    margin: 8px;
    text-decoration: none;
    border-radius: 10px;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    vertical-align: top;
    line-height: 1.4;
    text-align: center;
    min-height: 44px;
    box-sizing: border-box;
}

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.button:hover::before {
    left: 100%;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.button:active {
    transform: translateY(0);
}

/* Receive Button Styling */
.receive-button {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.receive-button:hover {
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

/* Result & Info Boxes */
.result, #cookies {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 25px;
    margin: 25px 0;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.2);
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    font-size: 0.95rem;
    line-height: 1.6;
    color: #2c3e50;
    word-wrap: break-word;
    word-break: break-all;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-x: auto;
}

.result-header {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.result-header .success {
    color: #27ae60;
    font-weight: bold;
}

.result-header .error {
    color: #e74c3c;
    font-weight: bold;
}

.result-details {
    background: rgba(236, 240, 241, 0.5);
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #3498db;
    color: #2c3e50;
}

.result-details pre {
    margin: 0;
    font-family: inherit;
    color: #2c3e50;
}

.result-details p {
    margin: 8px 0;
}

.result-details strong {
    color: #2c3e50;
}

/* Received Info Styling */
.received-info {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.95) 0%, rgba(46, 204, 113, 0.9) 100%);
    backdrop-filter: blur(10px);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.3);
    animation: slideIn 0.5s ease-out;
}

/* Loading Spinner */
.loading-spinner {
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

/* Enhanced Mobile Responsiveness */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .domain-info h1 {
        font-size: 3rem;
    }
    
    .button {
        padding: 14px 22px;
        font-size: 0.95rem;
        min-height: 48px;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 16px; /* Prevent zoom on iOS */
        -webkit-text-size-adjust: 100%;
    }
    
    .container {
        padding: 10px;
        margin: 5px;
        width: calc(100% - 10px);
    }
    
    .domain-info {
        padding: 20px 15px;
        text-align: center;
    }
    
    .domain-info h1 {
        font-size: 2.2rem;
        margin-bottom: 8px;
    }
    
    .domain-info p {
        font-size: 0.95rem;
        margin-bottom: 15px;
    }
    
    .domain-stats {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .stat {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .test-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .category-header {
        padding: 12px 15px;
        margin: 15px 0 10px 0;
    }
    
    .category-header h2 {
        font-size: 1.3rem;
    }
    
    .button {
        display: block;
        width: calc(100% - 16px);
        margin: 8px 8px;
        padding: 16px 20px;
        font-size: 1rem;
        border-radius: 12px;
        min-height: 52px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .result, #cookies {
        padding: 15px;
        margin: 15px 0;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    .result-header {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .result-details {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px;
        margin: 0;
        width: 100%;
        border-radius: 0;
    }
    
    .domain-info {
        padding: 15px 10px;
        border-radius: 0 0 15px 15px;
    }
    
    .domain-info h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .domain-info p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .test-section {
        padding: 12px;
        border-radius: 10px;
        margin: 10px 0;
    }
    
    .category-header {
        padding: 10px 12px;
        border-radius: 8px;
        margin: 10px 0 8px 0;
    }
    
    .category-header h2 {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .button {
        padding: 18px 16px;
        font-size: 0.95rem;
        margin: 6px 0;
        width: 100%;
        min-height: 56px;
        border-radius: 10px;
    }
    
    .result, #cookies {
        padding: 12px;
        font-size: 0.85rem;
        margin: 10px 0;
        border-radius: 8px;
    }
    
    .result-header {
        font-size: 1rem;
    }
    
    .result-details {
        font-size: 0.8rem;
    }
    
    /* Improved touch targets and interactions */
    .button:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Better text wrapping for mobile */
    .result-details pre {
        white-space: pre-wrap;
        word-break: break-word;
        font-size: 0.75rem;
    }
}

/* Enhanced focus states for accessibility */
.button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .result, .test-section {
        background: rgba(44, 62, 80, 0.95);
        color: #ecf0f1;
    }
    
    .result-details {
        background: rgba(52, 73, 94, 0.3);
        color: #bdc3c7;
    }
    
    .result-details pre {
        color: #ecf0f1;
    }
}
/* Formatted result styles */
.formatted-result {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.result-item {
    display: flex;
    align-items: flex-start;
    margin: 8px 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.result-item:last-child {
    border-bottom: none;
}

.result-item .key {
    font-weight: 600;
    color: #9b59b6;
    min-width: 140px;
    margin-right: 15px;
    font-size: 0.9rem;
}

.result-item .value {
    color: #ecf0f1;
    font-size: 0.9rem;
    flex: 1;
}

.result-item .value.success {
    color: #27ae60;
    font-weight: 600;
}

.result-item .value.error {
    color: #e74c3c;
    font-weight: 600;
}

.result-item .value.highlight {
    color: #e67e22;
    font-weight: 600;
    background: rgba(230, 126, 34, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.array-values {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.array-item {
    background: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.result-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    border-left: 4px solid #9b59b6;
}

.section-title {
    color: #9b59b6;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-content {
    margin-left: 10px;
}
