/* Harmony Generator Tool Styles */
.harmony-generator-tool {
    margin-bottom: 2rem;
}

.tool-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 0 auto;
}

/* Panel Styles */
.color-input-panel,
.harmony-selection-panel,
.palette-display-panel {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.panel-header {
    margin-bottom: 1.5rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

.panel-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.5rem 0 0 0;
}

/* Color Input Panel */
.color-input-group {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.color-picker-input {
    width: 80px;
    height: 80px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    background: none;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
}

.color-picker-input::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
}

.color-picker-input::-webkit-color-swatch {
    border: none;
    border-radius: 10px;
}

.color-picker-input::-moz-color-swatch {
    border: none;
    border-radius: 10px;
}

.color-preview-display {
    flex: 1;
    height: 80px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    background: linear-gradient(45deg, #f3f4f6 25%, transparent 25%),
                linear-gradient(-45deg, #f3f4f6 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #f3f4f6 75%),
                linear-gradient(-45deg, transparent 75%, #f3f4f6 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
    position: relative;
    overflow: hidden;
}

.color-preview-display .color-fill {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.input-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1rem;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.input-with-prefix {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.input-with-prefix:focus-within {
    border-color: #3498db;
    outline: none;
}

.input-prefix {
    padding: 0.75rem 0.5rem;
    background: #f9fafb;
    color: #6b7280;
    font-weight: 500;
    border-right: 1px solid #e5e7eb;
}

.text-input,
.number-input {
    width: 100%;
    padding: 0.75rem;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    color: #111827;
    outline: none;
}

.text-input::placeholder {
    color: #9ca3af;
}

.number-input {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    transition: border-color 0.2s ease;
}

.number-input:focus {
    border-color: #3498db;
    outline: none;
}

/* Harmony Selection Panel */
.harmony-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.harmony-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.harmony-card:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.harmony-card.active {
    border-color: #3498db;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.25);
}

.harmony-icon {
    font-size: 1.5rem;
    color: #3498db;
    font-weight: 600;
}

.harmony-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
}

.harmony-preview {
    display: flex;
    width: 100%;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    margin: 0.25rem 0;
}

.harmony-color {
    flex: 1;
    transition: all 0.3s ease;
}

.harmony-description {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: auto;
}

/* Palette Display Panel */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn.primary {
    background: #3498db;
    color: #ffffff;
}

.action-btn.primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.action-btn.secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.action-btn.secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.btn-icon {
    font-size: 1rem;
}

.btn-text {
    display: inline-block;
}

.palette-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.palette-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.palette-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.color-swatch {
    width: 100%;
    height: 100px;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    position: relative;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    background: linear-gradient(45deg, #f3f4f6 25%, transparent 25%),
                linear-gradient(-45deg, #f3f4f6 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #f3f4f6 75%),
                linear-gradient(-45deg, transparent 75%, #f3f4f6 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
}

.color-fill {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.color-code {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
    
}

.color-values {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.copy-color-btn {
    width: 100%;
    padding: 0.5rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.8125rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.copy-color-btn:hover {
    background: #3498db;
    color: #ffffff;
    border-color: #3498db;
}

.copy-color-btn.copied {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .tool-wrapper {
        gap: 1rem;
    }

    .color-input-panel,
    .harmony-selection-panel,
    .palette-display-panel {
        padding: 1rem;
    }

    .panel-title {
        font-size: 1.25rem;
    }

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

    .color-picker-input {
        width: 100%;
        height: 60px;
    }

    .color-preview-display {
        height: 60px;
    }

    .input-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .harmony-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .harmony-card {
        padding: 1rem;
    }

    .harmony-preview {
        height: 32px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-buttons {
        width: 100%;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
    }

    .palette-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .palette-item {
        padding: 0.75rem;
    }

    .color-swatch {
        height: 80px;
    }
}

@media (max-width: 480px) {
    .harmony-grid {
        grid-template-columns: 1fr;
    }

    .palette-container {
        grid-template-columns: 1fr;
    }

    .action-btn .btn-text {
        display: none;
    }

    .action-btn {
        padding: 0.625rem;
        min-width: 44px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
.harmony-card:focus,
.action-btn:focus,
.copy-color-btn:focus,
.text-input:focus,
.number-input:focus,
.color-picker-input:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}
