/* Tool Hero Section - Required by tool-page-structure.mdc */
.tool-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.hero-text {
    flex: 1;
    min-width: 260px;
}

.hero-text h1 {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 1rem;
    margin-top: 0;
}

@media (max-width: 767px) {
    .hero-text h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.125rem);
    }
}

/* Main Converter Wrapper */
.php-converter-wrapper {
    margin-bottom: 2rem;
}

/* Converter Layout */
.converter-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

/* Section Cards */
.section-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e8eaed;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 450px;
}

.section-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.output-card {
    border-color: #6366f1;
    border-width: 2px;
    background: linear-gradient(to bottom, #ffffff 0%, #fafbff 100%);
}

/* Card Header */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid #e8eaed;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

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

.card-label {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: #f1f3f5;
    color: #495057;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.output-label {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
}

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

/* Action Buttons */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #ffffff;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    color: #495057;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.action-btn:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #d0d5dd;
    color: #1a1a1a;
    transform: translateY(-1px);
}

.action-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.action-btn.primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-color: #6366f1;
    color: #ffffff;
}

.action-btn.primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.action-btn svg {
    flex-shrink: 0;
}

.action-btn span {
    display: none;
}

@media (min-width: 640px) {
    .action-btn span {
        display: inline;
    }
}

/* Editor Wrapper */
.editor-wrapper {
    flex: 1;
    position: relative;
    min-height: 400px;
    background: #1e1e1e;
    border-radius: 0;
}

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

/* Card Footer */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    background: #fafbfc;
    border-top: 1px solid #e8eaed;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

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

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

.status-indicator {
    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;
}

/* Options Section */
.options-section {
    margin-top: 1.5rem;
}

.options-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e8eaed;
    overflow: hidden;
    transition: all 0.3s ease;
}

.options-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.options-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e8eaed;
}

.options-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.5rem;
}

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

.options-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.option-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

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

/* Option Label */
.option-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.label-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1a1a1a;
}

.label-hint {
    font-size: 0.8125rem;
    color: #6b7280;
}

.option-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1.5px solid #e8eaed;
    border-radius: 12px;
    font-size: 0.9375rem;
    color: #1a1a1a;
    transition: all 0.2s ease;
}

.option-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

/* Toggle Switch */
.option-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
}

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

.toggle-slider {
    position: relative;
    width: 48px;
    height: 28px;
    background: #d1d5db;
    border-radius: 14px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

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

.option-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

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

.option-toggle input[type="checkbox"]:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

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

.toggle-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1a1a1a;
}

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

/* Mobile Responsive */
@media (max-width: 767px) {
    .converter-layout {
        gap: 1rem;
    }

    .section-card {
        min-height: 350px;
        border-radius: 16px;
    }

    .card-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .header-content {
        width: 100%;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

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

    .action-btn span {
        display: inline;
    }

    .editor-wrapper {
        min-height: 300px;
    }

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

    .card-footer {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .options-header {
        padding: 1.25rem 1.25rem 0.875rem;
    }

    .options-content {
        padding: 1.25rem;
        gap: 1rem;
    }

    .option-row {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .card-title {
        font-size: 1rem;
    }

    .card-label {
        font-size: 0.6875rem;
        padding: 0.2rem 0.6rem;
    }

    .action-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .options-title {
        font-size: 1.125rem;
    }

    .editor-wrapper {
        min-height: 250px;
    }

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

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

    .card-header {
        background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
        border-color: #374151;
    }

    .card-title {
        color: #f9fafb;
    }

    .card-label {
        background: #374151;
        color: #d1d5db;
    }

    .action-btn {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }

    .action-btn:hover:not(:disabled) {
        background: #4b5563;
        border-color: #6b7280;
    }

    .card-footer {
        background: #111827;
        border-color: #374151;
    }

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

    .options-header {
        border-color: #374151;
    }

    .options-title {
        color: #f9fafb;
    }

    .options-subtitle {
        color: #9ca3af;
    }

    .label-text {
        color: #f9fafb;
    }

    .label-hint {
        color: #9ca3af;
    }

    .option-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }

    .option-input:focus {
        border-color: #6366f1;
    }

    .toggle-title {
        color: #f9fafb;
    }

    .toggle-description {
        color: #9ca3af;
    }
}
