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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
    color: #333;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Container and Layout */
.container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

.box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 600px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.box:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* Header Styles */
.qr-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 30px;
    font-weight: 400;
}

/* Input Styles */
.input-group {
    margin-bottom: 20px;
}

#qrText {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 16px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s ease;
    background: #fafbfc;
}

#qrText:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

#qrText::placeholder {
    color: #8899a6;
}

.char-count {
    text-align: right;
    font-size: 0.875rem;
    color: #7f8c8d;
    margin-top: 8px;
    font-weight: 500;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.option-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.option-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.option-group select {
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: #fafbfc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-group select:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Color Options */
.color-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.color-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.color-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    background: #fafbfc;
    transition: all 0.3s ease;
}

.color-input-wrapper:focus-within {
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}

.color-hex {
    font-family: 'Monaco', 'Menlo', monospace;
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
}

/* Image Box */
.imgbox {
    margin: 30px 0;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #e1e8ed;
    border-radius: 20px;
    background: #fafbfc;
    position: relative;
    overflow: hidden;
}

.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8899a6;
    height: 100%;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.placeholder p {
    font-size: 1.1rem;
    font-weight: 500;
}

#qrImage {
    max-width: 100%;
    max-height: 300px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

#qrImage:hover {
    transform: scale(1.05);
}

/* Loading Animation */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #667eea;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e1e8ed;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Button Styles */
.qr-footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

button {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 200px;
}

#generateButton {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

#generateButton:active {
    transform: translateY(0);
}

.download-section {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

#downloadButton {
    background: linear-gradient(135deg, #56ab2f, #a8e6cf);
    color: white;
    box-shadow: 0 4px 15px rgba(86, 171, 47, 0.3);
}

#downloadButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(86, 171, 47, 0.4);
}

#shareButton {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

#shareButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
}

.help-text {
    font-size: 0.875rem;
    color: #8899a6;
    font-style: italic;
}

/* Error Message */
.error-message {
    display: none;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    margin: 16px 0;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

/* Features Section */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 800px;
}

.feature {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    padding: 30px 24px;
    border-radius: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 16px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.feature h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.feature p {
    color: #666;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .box {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .qr-header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .color-options {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .download-section {
        flex-direction: column;
        align-items: center;
    }
    
    button {
        min-width: 100%;
        max-width: 300px;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .imgbox {
        min-height: 250px;
    }
}

@media (max-width: 480px) {
    .box {
        padding: 20px 16px;
    }
    
    .qr-header h1 {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    #qrText {
        min-height: 100px;
    }
    
    .imgbox {
        min-height: 200px;
    }
}
