/* Hex to Flutter Color Picker Tool Styles */

/* Tool Container - Full Page Layout */
.hex-flutter-tool {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 0;
    margin: 0;
}

.tool-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.tool-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: rgb(34, 33, 33);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.tool-header h1 i {
    color: #02569B;
    font-size: 1.8rem;
}

.tool-description {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 0;
    line-height: 1.6;
}

/* Converter Interface */
.converter-interface {
    margin-bottom: 3rem;
}

.converter-card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    border: 1px solid #e5e7eb;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: start;
}

/* Input Section */
.input-section {
    flex: 1;
}

.method-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #f3f4f6;
    overflow-x: auto;
}

.method-tab {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.method-tab:hover {
    color: #02569B;
}

.method-tab.active {
    color: #02569B;
    border-bottom-color: #02569B;
}

.input-method {
    display: none;
}

.input-method.active {
    display: block;
}

/* Hex Input Method */
.hex-input-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

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

.hex-input-wrapper {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease-in-out;
    position: relative;
}

.hex-input-wrapper:focus-within {
    border-color: #02569B;
}

.hex-color-box {
    width: 40px;
    height: 40px;
    background-color: #FF5722;
    border-right: 1px solid #e5e7eb;
    flex-shrink: 0;
}

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

.hex-input {
    flex: 1;
    padding: 0.75rem;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
}

.random-color-btn {
    background: #02569B;
    color: white;
    border: none;
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.random-color-btn:hover {
    background: #0369a1;
}

.input-help {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Batch Input */
.batch-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.batch-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    resize: vertical;
    transition: border-color 0.2s ease-in-out;
}

.batch-input:focus {
    outline: none;
    border-color: #02569B;
}

.batch-convert-btn {
    background: #059669;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease-in-out;
}

.batch-convert-btn:hover {
    background: #047857;
}

/* Flutter Input Method */
.flutter-input-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.flutter-input-wrapper {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease-in-out;
    position: relative;
}

.flutter-input-wrapper:focus-within {
    border-color: #02569B;
}

.flutter-color-box {
    width: 40px;
    height: 40px;
    background-color: #f3f4f6;
    border-right: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.flutter-input {
    flex: 1;
    padding: 0.75rem;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
}

.convert-flutter-btn {
    background: #02569B;
    color: white;
    border: none;
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.convert-flutter-btn:hover {
    background: #0369a1;
}

.batch-convert-flutter-btn {
    background: #7c3aed;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease-in-out;
}

.batch-convert-flutter-btn:hover {
    background: #6d28d9;
}



/* Material Colors Method */
.material-colors-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.material-category {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.5rem;
}

.material-color-item {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.material-color-item:hover {
    border-color: #02569B;
    transform: scale(1.05);
}

.material-color-item.selected {
    border-color: #02569B;
    box-shadow: 0 0 0 2px rgba(2, 86, 155, 0.2);
}

/* Preview Section */
.preview-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 200px;
}

.color-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

/* Custom Always-Active Color Picker */
.custom-color-picker {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 2px solid #e5e7eb;
}

.color-picker-main {
    position: relative;
    width: 200px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    cursor: crosshair;
    border: 2px solid #e5e7eb;
    background:
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
}

#colorCanvas {
    display: block;
    border-radius: 6px;
}

.color-picker-cursor {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.5),
        0 0 8px rgba(0, 0, 0, 0.3),
        0 2px 6px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: all 0.15s ease-out;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
}

.color-picker-cursor::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.color-picker-cursor::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.4; transform: translate(-50%, -50%) scale(1.1); }
    100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
}

.hue-slider-container {
    position: relative;
    width: 200px;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e5e7eb;
}

#hueCanvas {
    display: block;
    border-radius: 8px;
}

.hue-cursor {
    position: absolute;
    top: 50%;
    width: 6px;
    height: 28px;
    background: linear-gradient(to bottom, #ffffff, #f0f0f0);
    border: 2px solid rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.8),
        0 0 8px rgba(0, 0, 0, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: all 0.15s ease-out;
}

.hue-cursor::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid rgba(0, 0, 0, 0.7);
    transform: translateX(-50%);
}

.hue-cursor::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid rgba(0, 0, 0, 0.7);
    transform: translateX(-50%);
}

.custom-color-picker:hover {
    border-color: #02569B;
    box-shadow: 0 12px 35px rgba(2, 86, 155, 0.25);
}

.color-picker-main:hover .color-picker-cursor {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.6),
        0 0 12px rgba(2, 86, 155, 0.4),
        0 3px 8px rgba(0, 0, 0, 0.3);
}

.hue-slider-container:hover .hue-cursor {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.9),
        0 0 12px rgba(2, 86, 155, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.4);
}

.color-picker-main:active .color-picker-cursor {
    transform: translate(-50%, -50%) scale(0.95);
}

.hue-slider-container:active .hue-cursor {
    transform: translate(-50%, -50%) scale(0.95);
}

.preview-info {
    text-align: center;
}

.preview-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview-hex {
    font-size: 1.125rem;
    font-weight: 700;
    color: #374151;
    font-family: 'Courier New', monospace;
}

.preview-rgb {
    font-size: 0.875rem;
    color: #6b7280;
    font-family: 'Courier New', monospace;
}

/* Results Section */
.results-section {
    margin-bottom: 3rem;
}

.results-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #e5e7eb;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.results-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-title i {
    color: #02569B;
}

.copy-all-btn {
    background: #02569B;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease-in-out;
}

.copy-all-btn:hover {
    background: #0369a1;
}

/* Format Results */
.format-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.format-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
}

.format-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.format-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.format-label i {
    color: #02569B;
}

.copy-btn {
    background: #059669;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.copy-btn:hover {
    background: #047857;
}

.format-code {
    background: #1f2937;
    color: #f9fafb;
    padding: 0.75rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
}

.format-code code {
    color: inherit;
    background: none;
}

/* Batch Results */
.batch-results {
    margin-top: 1.5rem;
}

.batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.batch-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.batch-actions {
    display: flex;
    gap: 0.5rem;
}

.export-btn {
    background: #7c3aed;
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease-in-out;
}

.export-btn:hover {
    background: #6d28d9;
}

.batch-code-container {
    background: #1f2937;
    border-radius: 8px;
    overflow: hidden;
}

.batch-code-container pre {
    margin: 0;
    padding: 1rem;
    color: #f9fafb;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
}

/* Flutter to Hex Results */
.flutter-hex-results {
    margin-top: 1.5rem;
}

.flutter-hex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.flutter-hex-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.flutter-hex-actions {
    display: flex;
    gap: 0.5rem;
}

.flutter-hex-container {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
}

/* Loading and Error States */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #02569B;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #fecaca;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

/* Palette Generator */
.palette-generator {
    margin-bottom: 3rem;
}

.palette-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.palette-title i {
    color: #02569B;
}

.palette-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #e5e7eb;
}

.palette-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.palette-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.palette-btn:hover {
    background: #e5e7eb;
}

.palette-btn.active {
    background: #02569B;
    color: white;
    border-color: #02569B;
}

.palette-display {
    min-height: 100px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-style: italic;
}

.palette-colors {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
}

.palette-color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.palette-color {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.palette-color:hover {
    transform: scale(1.05);
}

.palette-color-info {
    text-align: center;
}

.palette-color-hex {
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    color: #6b7280;
}

.palette-color-flutter {
    font-size: 0.625rem;
    font-family: 'Courier New', monospace;
    color: #02569B;
    cursor: pointer;
}

.palette-color-flutter:hover {
    text-decoration: underline;
}

/* Popular Flutter Colors */
.popular-flutter-colors {
    margin-bottom: 3rem;
}

.popular-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.popular-title i {
    color: #fbbf24;
}

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

.popular-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.popular-item:hover {
    border-color: #02569B;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.popular-color {
    width: 100%;
    height: 60px;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    border: 1px solid #e5e7eb;
}

.popular-info {
    text-align: center;
}

.popular-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.popular-hex {
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.popular-flutter {
    font-size: 0.625rem;
    font-family: 'Courier New', monospace;
    color: #02569B;
}

/* Related Tools Section */
.related-tools-section {
    margin-bottom: 3rem;
}

.related-tools-header {
    margin-bottom: 1rem;
}

.related-tools-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.related-tools-header h3 i {
    color: #02569B;
}

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

.related-tool-link {
    background: white;
    color: #374151;
    text-decoration: none;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.related-tool-link:hover {
    border-color: #02569B;
    color: #02569B;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.related-tool-link i {
    color: #02569B;
    font-size: 1.125rem;
}

/* SEO Content */
.seo-content {
    background: white;
    padding: 3rem 2rem;
    margin-top: 3rem;
    border-top: 1px solid #e5e7eb;
}

.seo-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 1rem;
}

.seo-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin: 1.5rem 0 0.75rem 0;
}

.seo-content p {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.seo-content ul, .seo-content ol {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.seo-content li {
    margin-bottom: 0.5rem;
}

.seo-content strong {
    color: #374151;
    font-weight: 600;
}

.mb-10 {
    margin-bottom: 2.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-container {
        padding: 1rem;
    }
    
    .converter-card {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
    
    .method-tabs {
        flex-wrap: wrap;
    }
    
    .popular-grid {
        grid-template-columns: 1fr;
    }
    
    .related-tools-grid {
        grid-template-columns: 1fr;
    }
    
    .palette-controls {
        justify-content: center;
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .batch-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .batch-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .tool-header h1 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .custom-color-picker {
        padding: 12px;
    }

    .color-picker-main {
        width: 160px;
        height: 120px;
    }

    #colorCanvas {
        width: 160px;
        height: 120px;
    }

    .hue-slider-container {
        width: 160px;
        height: 16px;
    }

    #hueCanvas {
        width: 160px;
        height: 16px;
    }
    
    .color-picker-input {
        width: 80px;
        height: 80px;
    }
    
    .material-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }
    
    .material-color-item {
        width: 50px;
        height: 50px;
    }
    
    .palette-colors {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .palette-color {
        width: 60px;
        height: 60px;
    }
}
