/* Cookie Converter Tool Styles */

/* Hero Section */
.cookie-converter-hero {
    position: relative;
    overflow: hidden;
    height: 560px;
    padding: 0;
    background-color: rgb(0, 3, 35);
    background-image: url('../assets/images/main-bg.webp');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
}

.cookie-converter-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 3, 35, .85);
}

.cookie-converter-hero .hero-layout {
    position: relative;
    z-index: 2;
    display: block;
    height: 100%;
}

.cookie-converter-hero .hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-top: -260px;
    text-align: center;
    align-items: center;
    justify-content: center;
}

.cookie-converter-hero .hero-kicker {
    color: var(--accent-color);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    opacity: 1;
}

.cookie-converter-hero .hero-title {
    color: #fff;
    font-size: 3.5rem;
    line-height: 1.1;
    font-weight: 800;
    margin: 0;
    text-align: center;
}

.cookie-converter-hero .hero-subtitle {
    color: #fff;
    opacity: .9;
    text-align: center;
    margin: .25rem 0 1rem;
    font-size: 1.5rem;
}

.format-list {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0 0;
    padding: 0;
}

.format-list li {
    background: #fff1;
    backdrop-filter: blur(10px);
    border: 1px solid #fff3;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

/* Tool Section */
.cookie-converter-tool {
    position: relative;
    margin-top: -300px !important;
    z-index: 10;
}

.converter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.converter-panel {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 1.25rem;
    padding: 1.5rem;
    height: 100%;
    min-height: 500px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.converter-panel:hover {
    transform: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

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

.converter-panel label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
}

/* Custom Select Styles */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.custom-select {
    position: relative;
    display: inline-block;
}

.select-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #9ca3af;
    /* Matches placeholder/label color in dark mode */
    cursor: pointer;
    transition: color 0.2s ease;
}

.select-trigger:hover {
    color: #fff;
}

.trigger-arrow {
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.custom-select.open .trigger-arrow {
    transform: rotate(180deg);
}

.select-options {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: #1f2937;
    /* Matches output panel bg */
    border: 1px solid #374151;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    min-width: 250px;
    z-index: 50;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-select.open .select-options {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.select-option {
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: #d1d5db;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.select-option:hover,
.select-option.selected {
    background: #374151;
    color: #fff;
}

.select-option.selected {
    font-weight: 600;
    background: #4b5563;
}

.converter-panel textarea {
    flex: 1;
    resize: none;
    padding: 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #1f2937;
    height: 100%;
    min-height: 320px;
    transition: all 0.2s ease;
}

.converter-panel textarea::placeholder {
    color: #9ca3af;
    font-style: normal;
    opacity: 0.7;
}

.converter-panel textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(217, 30, 43, 0.08);
}

.converter-panel--output {
    background: #111827;
    border-color: #1f2937;
}

.converter-panel--output .panel-header {
    border-bottom-color: #1f2937;
}

.converter-panel--output label {
    color: #6b7280;
}

.converter-panel--output textarea {
    background: #0d1117;
    border-color: #1f2937;
    color: #e5e7eb;
}

.converter-panel--output textarea::placeholder {
    color: #4b5563;
    opacity: 1;
}

.converter-panel--output textarea:focus {
    border-color: #3b82f6;
    background: #0d1117;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.converter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
    align-items: center;
}

.converter-actions svg {
    width: 24px;
    height: 24px;
}

.converter-panel--output .converter-actions {
    border-top-color: #1f2937;
}

.converter-actions--end {
    justify-content: space-between;
}

.converter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.converter-btn:hover {
    transform: translateY(-1px);
}

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

.converter-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.converter-btn--primary {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(217, 30, 43, 0.2), 0 2px 4px -1px rgba(217, 30, 43, 0.1);
}

.converter-btn--primary:hover {
    background: var(--accent-color-hover);
    box-shadow: 0 10px 15px -3px rgba(217, 30, 43, 0.3), 0 4px 6px -2px rgba(217, 30, 43, 0.15);
}

.converter-btn--secondary {
    background: #374151;
    color: #e5e7eb;
    border: 1px solid #4b5563;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.converter-btn--secondary:hover {
    background: #4b5563;
    color: #fff;
    border-color: #6b7280;
}

.converter-btn--ghost {
    background: transparent;
    color: #6b7280;
    border: 1px solid transparent;
}

.converter-btn--ghost:hover {
    background: #f3f4f6;
    color: #111827;
}

.converter-status {
    text-align: left;
    min-height: 1.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: #6b7280;
    transition: color 0.2s ease;
}

.converter-status[data-state="success"] {
    color: #10b981;
}

.converter-status[data-state="error"] {
    color: #ef4444;
}

.converter-status[data-state="warning"] {
    color: #f59e0b;
}

.converter-note {
    margin-top: 1.5rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-converter-hero {
        height: auto;
        min-height: 500px;
        padding: 80px 20px;
    }

    .cookie-converter-hero .hero-content {
        position: relative;
        inset: auto;
        margin-top: 0;
    }

    .cookie-converter-hero .hero-title {
        font-size: 2.5rem;
    }

    .cookie-converter-hero .hero-subtitle {
        font-size: 1.125rem;
    }

    .cookie-converter-tool {
        margin-top: -240px !important;
    }

    .converter-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .converter-panel {
        min-height: 350px;
    }

    .converter-panel textarea {
        min-height: 260px;
        font-size: 0.8125rem;
    }

    .converter-actions {
        flex-direction: column;
    }

    .converter-btn {
        width: 100%;
    }

    .converter-actions--end {
        justify-content: stretch;
    }
}

@media (max-width: 480px) {
    .cookie-converter-hero .hero-title {
        font-size: 2rem;
    }

    .format-list {
        gap: 0.5rem;
    }

    .format-list li {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}