:root {
    --bg-color: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --accent: #f59e0b; /* Amber/Orange */
    --accent-hover: #d97706;
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.app-container {
    max-width: 900px;
    width: 100%;
}

.app-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Control Panel */
.control-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.input-group, .setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

label {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 24px;
    height: 56px;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    background: transparent;
}

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

input[type="text"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    font-family: monospace;
    font-size: 1rem;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
}

input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Radios */
.radio-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-radio {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #fff;
    transition: border-color 0.2s ease;
    flex-shrink: 0;
}

input[type="radio"]:checked + .custom-radio {
    border-color: var(--accent);
}

.custom-radio::after {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="radio"]:checked + .custom-radio::after {
    transform: scale(1);
}

/* Slider */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #dde3eb;
    border-radius: 3px;
    outline: none;
    margin-top: 0.5rem;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

/* Visualization Panel */
.visualization-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.color-box-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.color-box-container h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

.color-block {
    width: 100%;
    height: 220px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: background-color 0.4s ease;
    position: relative;
    border: 1px solid rgba(255,255,255,0.4);
}

.simulated {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Info Button and Popup */
.info-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0,0,0,0.05);
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(4px);
    z-index: 2;
}

.info-btn:hover {
    transform: scale(1.1);
    background: #fff;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.popup-box {
    position: absolute;
    bottom: -50px;
    right: 0;
    background: var(--text-primary);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 10;
    white-space: nowrap;
    text-align: center;
    line-height: 1.4;
}

.popup-box::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 36px;
    width: 12px;
    height: 12px;
    background: var(--text-primary);
    transform: rotate(45deg);
}

.popup-box.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .visualization-panel {
        grid-template-columns: 1fr;
    }
    .color-block {
        height: 180px;
    }
}

.input-block {
    /* (If specific height or width is needed later) */
}

.output-block {
    cursor: pointer;
    position: relative;
}

.copy-tooltip {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 5;
    white-space: nowrap;
}

.output-block:hover .copy-tooltip:not(.copied) {
    transition-delay: 1s;
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.copy-tooltip.copied {
    transition-delay: 0s;
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.copy-tooltip.force-hide {
    opacity: 0 !important;
    visibility: hidden !important;
    transition-delay: 0s !important;
}

/* Disclaimer Section */
.disclaimer-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
}

.disclaimer-title {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
}

.disclaimer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.disclaimer-item {
    background: transparent;
    padding: 1rem;
    border-radius: 8px;
}

.disclaimer-item h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.disclaimer-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.disclaimer-item a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.disclaimer-item a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}
