:root {
    --surface: #ffffff;
    --surface-muted: #f4f6fb;
    --border: #e3e8f2;
    --text-main: #1c2333;
    --text-muted: #5f6b85;
    --primary: #0d47fb;
    --primary-dark: #0a2fa3;
    --accent: #8b5cf6;
    --success: #22c55e;
    --warning: #f59e0b;
    --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 8px 24px rgba(13, 71, 251, 0.15);
    --gradient: linear-gradient(135deg, #0d47fb 0%, #8b5cf6 100%);
}

/* Tool Wrapper */
.tool-wrapper {
    margin-bottom: 40px;
}

/* Panel and Card Styles */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    padding: 32px;
    height: 100%;
    transition: background 0.3s ease, border 0.3s ease;
}

.tool-card {
    margin-bottom: 40px;
}

.color-picker-card {
    padding: 0;
    overflow: hidden;
}

/* Color Picker Header */
.color-picker-header {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 32px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
}

/* Color Preview Large */
.color-preview-large {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 400px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: var(--primary);
}

.color-preview-large:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.color-preview-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
}

.color-preview-text {
    font-size: clamp(24px, 5vw, 48px);
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    
    letter-spacing: 2px;
}

/* Color Picker Controls */
.color-picker-controls {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

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

.color-input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-input {
    width: 100%;
    height: 56px;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: var(--surface);
}

.color-input:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 71, 251, 0.1);
}

.color-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 71, 251, 0.15);
}

/* Random Color Button */
.btn-random-color {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--gradient);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(13, 71, 251, 0.25);
}

.btn-random-color:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 71, 251, 0.35);
}

.btn-random-color:active {
    transform: translateY(0);
}

.btn-random-color i {
    font-size: 18px;
}

/* Color Formats Grid */
.color-formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 32px;
}

.color-format-card {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.color-format-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(13, 71, 251, 0.1);
    transform: translateY(-2px);
}

.color-format-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.color-format-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-copy-color {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy-color:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    transform: scale(1.1);
}

.btn-copy-color:active {
    transform: scale(0.95);
}

.btn-copy-color.copied {
    background: var(--success);
    border-color: var(--success);
    color: #ffffff;
}

.btn-copy-color.copied i::before {
    content: "\f00c";
}

.color-format-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    
    word-break: break-all;
    line-height: 1.4;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .color-picker-header {
        padding: 24px 20px;
    }

    .color-preview-large {
        aspect-ratio: 4 / 3;
    }

    .color-preview-text {
        font-size: clamp(20px, 6vw, 32px);
    }

    .color-picker-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .color-input-wrapper {
        min-width: 100%;
    }

    .btn-random-color {
        width: 100%;
        justify-content: center;
    }

    .color-formats-grid {
        grid-template-columns: 1fr;
        padding: 24px 20px;
        gap: 16px;
    }

    .panel {
        padding: 0;
    }
}

@media (max-width: 480px) {
    .color-picker-header {
        padding: 20px 16px;
    }

    .color-formats-grid {
        padding: 20px 16px;
    }

    .color-format-value {
        font-size: 16px;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    :root {
        --surface: #1c2333;
        --surface-muted: #2a3441;
        --border: #3a4553;
        --text-main: #f4f6fb;
        --text-muted: #94a3b8;
    }
}

