/* Main Container */
.java-converter-container {
    margin-bottom: 3rem;
}

/* Converter Card - Single full-width card */
.converter-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Options Row - Top row with all options */
.options-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1.25rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

/* Converter Grid - Mobile First */
.converter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .converter-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

/* Panel Styles */
.input-panel,
.output-panel {
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    min-height: 650px;
}

.output-panel {
    border-color: #3b82f6;
    border-width: 2px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
}

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

/* Panel Header */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.panel-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

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

.panel-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    background: #e5e7eb;
    color: #6b7280;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.output-badge {
    background: #dbeafe;
    color: #1e40af;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Icon Buttons */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.icon-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
}

.icon-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.icon-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.icon-btn.primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.icon-btn.primary:hover:not(:disabled) {
    background: #2563eb;
    border-color: #2563eb;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

/* Editor Container */
.editor-container {
    flex: 1;
    position: relative;
    min-height: 600px;
    background: #ffffff;
}

.code-editor {
    width: 100%;
    height: 100%;
    min-height: 600px;
}

/* Panel Footer */
.panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-item {
    font-size: 0.8125rem;
    color: #6b7280;
    font-weight: 500;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-text {
    font-size: 0.8125rem;
    color: #6b7280;
    font-weight: 500;
}

/* Option Field - Used in options-row */

.option-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
    flex: 0 1 auto;
}

.field-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

.label-hint {
    font-size: 0.75rem;
    color: #9ca3af;
}

.field-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    color: #111827;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.field-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* Toggle Switches - Now integrated in options-grid */

.toggle-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    cursor: pointer;
    user-select: none;
    flex: 0 1 auto;
    min-width: 180px;
}

.toggle-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-item input[type="checkbox"]:checked + .toggle-switch {
    background: #3b82f6;
}

.toggle-item input[type="checkbox"]:checked + .toggle-switch::before {
    transform: translateX(20px);
}

.toggle-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
}

.toggle-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #111827;
}

.toggle-desc {
    font-size: 0.8125rem;
    color: #6b7280;
}

/* Mobile Optimizations */
@media (max-width: 767px) {
    .converter-card {
        padding: 1rem;
    }

    .options-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .option-field {
        min-width: 100%;
    }

    .toggle-item {
        min-width: 100%;
    }

    .converter-grid {
        gap: 1rem;
    }

    .input-panel,
    .output-panel {
        min-height: 400px;
    }

    .code-editor {
        min-height: 400px;
    }

    .panel-header {
        padding: 0.875rem 1rem;
    }

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

/* Fullscreen Modal */
.fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 9999;
    flex-direction: column;
}

.fullscreen-modal.active {
    display: flex;
}

.fullscreen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.fullscreen-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.fullscreen-editors-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    flex: 1;
    overflow: hidden;
    border-top: 1px solid #e5e7eb;
}

.fullscreen-panel {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    overflow: hidden;
}

.fullscreen-panel:last-child {
    border-right: none;
}

.fullscreen-panel-header {
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.fullscreen-panel-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.fullscreen-editor-container {
    flex: 1;
    position: relative;
    background: #ffffff;
    overflow: hidden;
}

.fullscreen-editor-container .code-editor {
    min-height: 100%;
    height: 100%;
}

@media (max-width: 767px) {
    .fullscreen-editors-grid {
        grid-template-columns: 1fr;
    }

    .fullscreen-panel {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .fullscreen-panel:last-child {
        border-bottom: none;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .converter-card {
        background: #1f2937;
        border-color: #374151;
    }

    .options-row {
        border-bottom-color: #374151;
    }

    .input-panel,
    .output-panel {
        background: #111827;
        border-color: #374151;
    }

    .panel-header,
    .panel-footer {
        background: #111827;
        border-color: #374151;
    }

    .panel-title {
        color: #f9fafb;
    }

    .stat-item,
    .status-text {
        color: #9ca3af;
    }

    .field-input {
        background: #1f2937;
        border-color: #4b5563;
        color: #f9fafb;
    }

    .toggle-name {
        color: #f9fafb;
    }

    .fullscreen-modal {
        background: #1f2937;
    }

    .fullscreen-header {
        background: #111827;
        border-color: #374151;
    }

    .fullscreen-title {
        color: #f9fafb;
    }

    .fullscreen-editor-container {
        background: #1f2937;
    }

    .fullscreen-editors-grid {
        border-top-color: #374151;
    }

    .fullscreen-panel {
        border-right-color: #374151;
        background: #1f2937;
    }

    .fullscreen-panel-header {
        background: #111827;
        border-bottom-color: #374151;
    }

    .fullscreen-panel-title {
        color: #f9fafb;
    }
}
