/* Advanced Color Converter Tool Styles */

/* Ensure proper spacing after sticky header */
body {
    padding-top: 0;
}

.hero-section {
    background: linear-gradient(135deg, #ff5722 0%, #e91e63 50%, #9c27b0 100%);
    color: white;
    padding: 3rem 0 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.1"><circle cx="30" cy="30" r="8"/><circle cx="10" cy="10" r="4"/><circle cx="50" cy="10" r="4"/><circle cx="10" cy="50" r="4"/><circle cx="50" cy="50" r="4"/></g></svg>') repeat;
    opacity: 0.3;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.hero-icon {
    font-size: 3.5rem;
    margin-right: 1rem;
    opacity: 0.9;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 0;
    opacity: 0.95;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.tool-main {
    padding: 3rem 0;
    background: #f8fafc;
    /* Remove conflicting min-height that interferes with global footer layout */
    /* min-height: calc(100vh - 200px); */
}

.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.tool-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.3s ease;
}

.tool-panel:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.panel-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #334155;
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #ff5722 0%, #e91e63 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

.btn-secondary:hover {
    background: #cbd5e1;
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.form-section {
    padding: 1.5rem;
}

.color-preview-container {
    margin-bottom: 2rem;
}

.color-preview {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.preview-main {
    height: 120px;
    background: linear-gradient(135deg, #1976d2 0%, #1976d2 100%);
    transition: background 0.3s ease;
    position: relative;
}

.preview-main::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
}

.preview-details {
    padding: 1rem;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.preview-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
}

.preview-contrast {
    display: flex;
    gap: 0.5rem;
}

.contrast-demo {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.contrast-demo.light {
    background: rgba(255,255,255,0.9);
    color: #1e293b;
}

.contrast-demo.dark {
    background: rgba(0,0,0,0.9);
    color: white;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #334155;
}

.input-wrapper {
    display: flex;
    gap: 0.5rem;
}

#color-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

#color-input:focus {
    outline: none;
    border-color: #ff5722;
    box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.1);
}

#color-picker {
    width: 60px;
    height: 46px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

#color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
}

#color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.format-options {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.format-options h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: #475569;
    gap: 0.75rem;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-mark {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
    background: white;
}

.radio-option input[type="radio"]:checked + .radio-mark {
    border-color: #ff5722;
    background: #ff5722;
}

.radio-option input[type="radio"]:checked + .radio-mark::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.conversions-section {
    padding: 1rem;
    max-height: 600px;
    overflow-y: auto;
}

.conversion-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.conversion-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.conversion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.conversion-title {
    font-weight: 600;
    color: #334155;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.conversion-actions {
    display: flex;
    gap: 0.25rem;
}

.action-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.conversion-output {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #1e293b;
    word-break: break-all;
    position: relative;
}

.conversion-output .color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-block;
    margin-right: 0.5rem;
    border: 1px solid #e2e8f0;
    vertical-align: middle;
}

.conversion-output.empty {
    color: #94a3b8;
    font-style: italic;
}

.advanced-tools {
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.tool-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.tool-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.harmony-display,
.shades-display {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.color-chip {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
}

.color-chip:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.color-chip::after {
    content: attr(data-color);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: #64748b;
    white-space: nowrap;
}

.tool-controls {
    margin-top: 1rem;
}

.tool-controls select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
}

.accessibility-display {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.accessibility-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.accessibility-label {
    font-size: 0.875rem;
    color: #475569;
}

.accessibility-value {
    font-weight: 600;
    font-size: 0.875rem;
}

.accessibility-value.good {
    color: #059669;
}

.accessibility-value.fair {
    color: #d97706;
}

.accessibility-value.poor {
    color: #dc2626;
}

.colorblind-display {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.colorblind-item {
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
}

.colorblind-swatch {
    width: 100%;
    height: 30px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    margin-bottom: 0.25rem;
}

.history-grid {
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: #f8fafc;
}

.history-item:hover {
    border-color: #ff5722;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.history-item::after {
    content: attr(data-color);
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: #64748b;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    white-space: nowrap;
}

.info-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e2e8f0;
    margin-top: 2rem;
}

.info-section h2 {
    margin-bottom: 1.5rem;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.info-card h3 {
    margin-bottom: 1rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.info-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.875rem;
    line-height: 1.4;
}

.info-card li:last-child {
    border-bottom: none;
}

.info-card strong {
    color: #334155;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: #10b981;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    background: #ef4444;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #ff5722;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: #475569;
}

.empty-state p {
    margin: 0;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-icon {
        font-size: 2.5rem;
        margin-right: 0.5rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .tool-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .panel-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .panel-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .radio-group {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .info-grid,
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .conversion-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .notification {
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .tool-main {
        padding: 1.5rem 0;
    }
    
    .hero-section {
        padding: 2rem 0 1.5rem;
    }
    
    .panel-header {
        padding: 1rem;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    .advanced-tools {
        padding: 0.75rem;
    }
    
    .info-section {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .input-wrapper {
        flex-direction: column;
    }
    
    #color-picker {
        width: 100%;
        height: 50px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .tool-main {
        background: #0f172a;
    }
    
    .tool-panel {
        background: #1e293b;
        border-color: #334155;
    }
    
    .panel-header {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        border-color: #334155;
    }
    
    .panel-header h2 {
        color: #e2e8f0;
    }
    
    #color-input {
        background: #0f172a;
        border-color: #334155;
        color: #e2e8f0;
    }
    
    #color-input:focus {
        border-color: #ff5722;
        background: #1e293b;
    }
    
    .conversion-item,
    .tool-card {
        background: #0f172a;
        border-color: #334155;
    }
    
    .conversion-output {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }
    
    .info-section {
        background: #1e293b;
        border-color: #334155;
    }
    
    .info-card {
        background: #0f172a;
        border-color: #334155;
    }
}

/* Print styles */
@media print {
    .hero-section,
    .panel-actions,
    .advanced-tools,
    .info-section {
        display: none;
    }
    
    .tool-panel {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
    
    .conversion-output {
        border: 1px solid #ccc;
        background: white !important;
        color: black !important;
    }
}
