/* ============================================
   ROOT VARIABLES & BASE STYLES
   ============================================ */
:root {
    --primary-gradient: linear-gradient(135deg, #89f7fe, #66a6ff);
    --primary-dark: #4a90e2;
    --card-gradient: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    --success-color: #10b981;
    --success-light: #d1fae5;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-light: #f9fafb;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --shadow: 0 10px 25px -5px rgba(66, 153, 225, 0.15), 0 8px 10px -6px rgba(66, 153, 225, 0.1);
    --shadow-hover: 0 20px 40px -10px rgba(66, 153, 225, 0.25), 0 10px 10px -5px rgba(66, 153, 225, 0.1);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #89f7fe, #66a6ff);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.5;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ============================================
   MAIN WRAPPER & CONTAINER
   ============================================ */
.wrapper {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================
   HEADER SECTION
   ============================================ */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.header:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.header-content {
    max-width: 700px;
    margin: 0 auto;
}

.header-icon {
    font-size: 2.8rem;
    margin-bottom: 20px;
    opacity: 0.95;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.header h1 {
    margin-bottom: 15px;
    color: white;
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.15rem;
    opacity: 0.95;
    font-weight: 300;
    line-height: 1.6;
}

/* ============================================
   MAIN CARD (Replaces .container)
   ============================================ */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin-bottom: 30px;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* ============================================
   SECTION STYLES
   ============================================ */
.input-section, .result-section, .examples-section {
    padding: 35px 30px;
    border-bottom: 1px solid var(--border-color);
}

.input-section {
    padding-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h2 i {
    color: var(--primary-dark);
}

.format-tags {
    display: flex;
    gap: 12px;
}

.tag {
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Courier New', Courier, monospace;
    transition: all 0.2s ease;
}

.rgb-tag {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.hex-tag {
    background-color: #f0f9ff;
    color: #0c4a6e;
    border: 1px solid #e0f2fe;
}

.auto-detect {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--success-color);
    font-weight: 500;
    background: var(--success-light);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
}

/* ============================================
   INPUT & BUTTON STYLES
   ============================================ */
.input-group {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.input-wrapper {
    flex: 1;
    min-width: 300px;
}

.input-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
}

.modern-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-family: 'Courier New', Courier, monospace;
    transition: all 0.3s ease;
    background-color: var(--bg-light);
    color: var(--text-primary);
}

.modern-input:focus {
    outline: none;
    border-color: #66a6ff;
    box-shadow: 0 0 0 3px rgba(102, 166, 255, 0.2);
    background-color: white;
}

.input-hint {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Button Styles */
.primary-btn {
    padding: 16px 32px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    white-space: nowrap;
    height: fit-content;
    box-shadow: 0 4px 6px rgba(102, 166, 255, 0.2);
}

.primary-btn:hover {
    background: linear-gradient(135deg, #7ae1f3, #4a90e2);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* ============================================
   RESULT SECTION
   ============================================ */
.result-card {
    background: var(--card-gradient);
    border-radius: var(--radius-md);
    padding: 30px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.result-card:hover {
    border-color: var(--border-hover);
}

.result-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .result-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

.result-text, .color-display {
    display: flex;
    flex-direction: column;
}

.result-label, .preview-label {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.result-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 18px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    min-height: 70px;
    transition: border-color 0.3s;
}

.result-value:hover {
    border-color: var(--border-hover);
}

.result-value code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
    padding-right: 10px;
}

/* Copy Button */
.copy-btn {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 10px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    color: var(--success-color);
    border-color: var(--success-color);
    background-color: rgba(16, 185, 129, 0.05);
}

/* Color Preview */
.color-preview {
    height: 150px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s ease;
}

.color-preview:hover {
    border-color: var(--border-hover);
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.preview-placeholder i {
    font-size: 2rem;
    opacity: 0.7;
}

/* Color Info */
.color-info {
    display: flex;
    gap: 40px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.info-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.info-value {
    font-weight: 600;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
}

.info-value.ready {
    color: var(--success-color);
}

/* ============================================
   EXAMPLES SECTION
   ============================================ */
.examples-section {
    border-bottom: none;
}

.examples-section h3 {
    font-size: 1.4rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
}

.example-btn {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.example-btn:hover {
    border-color: #66a6ff;
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.example-color {
    height: 70px;
    border-radius: var(--radius-sm);
    width: 100%;
    transition: transform 0.3s ease;
}

.example-btn:hover .example-color {
    transform: scale(1.02);
}

.example-btn span {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.example-btn code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-light);
    padding: 4px 8px;
    border-radius: 4px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: 25px;
    color: white;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

.footer i {
    margin-right: 8px;
}

.footer-note {
    margin-top: 12px;
    font-size: 0.9rem;
    opacity: 0.9;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1.05rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-wrapper {
        min-width: 100%;
    }
    
    .examples-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .input-section, .result-section, .examples-section {
        padding: 25px 20px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .header {
        padding: 30px 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
    
    .footer {
        padding: 20px 15px;
    }
                                                                                      }
