/* ===== Material Symbols ===== */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ===== Template Design Utilities ===== */
.gradient-bg {
    background: linear-gradient(135deg, #000000, #0f172a, #581c87);
}

.gradient-text {
    background: linear-gradient(to right, #ff00ff, #8a2be2, #00bfff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.headline-bg {
    background-color: rgba(0, 0, 0, 0.7);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1.gradient-text.headline-bg {
    text-shadow: none;
}

/* ===== Section Cards ===== */
.tool-card,
.bg-surface-container-low {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.tool-card:hover,
.bg-surface-container-low.glow-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border-color: rgba(138, 43, 226, 0.3);
}

.glow-box {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

/* ===== FAQ Accordion ===== */
.faq-item {
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 16px 20px;
    background: #f9fafb;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(138, 43, 226, 0.3);
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.faq-item .faq-icon {
    color: #8b5cf6 !important;
}

/* ===== Collapsible Navigation ===== */
.collapse-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.collapse-nav.open {
    max-height: 2000px;
}

.collapse-trigger {
    cursor: pointer;
    user-select: none;
}

.collapse-arrow {
    transition: transform 0.3s ease;
    display: inline-block;
}

.collapse-arrow.open {
    transform: rotate(180deg);
}

/* ===== Mobile Nav ===== */
.mobile-nav {
    background: #fff;
    border-color: #e5e7eb;
}

.header-bar {
    height: 64px;
}

.mobile-nav .border-t { border-color: #e5e7eb; }

.hamburger-btn {
    border: none;
    background: transparent;
    cursor: pointer;
}

.hamburger-spacer {
    visibility: hidden;
}

@media (min-width: 768px) {
    .hamburger-btn { display: none; }
    .hamburger-spacer { display: none; }
}

/* ===== Mode Tabs ===== */
#modeTabs {
    display: flex;
    flex-wrap: wrap;
}

.mode-tab {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 10px 22px;
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #f9fafb;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mode-tab:hover {
    border-color: #8b5cf6;
    color: #374151;
}

.mode-tab.active {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    color: #fff;
    border-color: #7c3aed;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.25);
}

.mode-tab .material-symbols-outlined {
    font-size: 18px;
}

/* ===== Download Button ===== */
.download-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 14px 36px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ec4899, #8b5cf6, #3b82f6);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3);
}

.download-btn:hover:not(:disabled) {
    box-shadow: 0 2px 32px rgba(139, 92, 246, 0.4);
    transform: scale(1.03);
    background: linear-gradient(135deg, #f472b6, #a78bfa, #60a5fa);
}

.download-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.download-btn .material-symbols-outlined {
    font-size: 20px;
}

/* ===== Clear Button ===== */
.clear-btn {
    font-size: 13px;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: var(--radius);
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.clear-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

.clear-btn .material-symbols-outlined {
    font-size: 16px;
}

/* ===== Status Toast ===== */
.status-toast {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 20px;
    border-radius: var(--radius);
    transition: opacity 0.3s ease;
}

.status-toast.ok { background: #ecfdf5; color: #065f46; }
.status-toast.warn { background: #fffbeb; color: #92400e; }
.status-toast.error { background: #fef2f2; color: #991b1b; }

/* ===== Controls Row ===== */
.converter-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ===== Upload Zone ===== */
.upload-zone {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-zone:hover, .upload-zone.drag-over {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.04);
}

.upload-icon {
    font-size: 48px;
    color: #8b5cf6;
}

.upload-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.upload-hint {
    font-size: 14px;
    color: #9ca3af;
}

.oversize-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #dc2626;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: var(--radius);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
}

.oversize-toast.show {
    opacity: 1;
}

/* ===== Aspect Ratio Presets ===== */
.preset-section {
    text-align: center;
}

.preset-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    display: block;
}

.preset-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.preset-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 8px 20px;
    border-radius: var(--radius);
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    color: #6b7280;
}

.preset-btn:hover {
    border-color: #8b5cf6;
    color: #374151;
}

.preset-btn.active {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    color: #fff;
    border-color: #7c3aed;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
}

/* ===== Custom Size Inputs ===== */
.custom-size-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.custom-size-input {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    width: 130px;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    text-align: center;
    outline: none;
    transition: all 0.2s ease;
}

.custom-size-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.custom-size-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
}

.custom-size-input::-webkit-inner-spin-button,
.custom-size-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.custom-size-input[type=number] {
    -moz-appearance: textfield;
}

.custom-size-sep {
    font-size: 18px;
    color: #9ca3af;
    font-family: 'JetBrains Mono', monospace;
}

/* ===== Crop Preview Canvas ===== */
.crop-preview-container {
    width: 100%;
    justify-content: center;
}

.crop-canvas {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid rgba(139, 92, 246, 0.3);
    background: #f9fafb;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.08), 0 4px 24px rgba(0, 0, 0, 0.06);
    cursor: default;
    touch-action: none;
    user-select: none;
}

/* ===== File List ===== */
.file-list-container {
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    overflow: hidden;
}

.file-list-header {
    text-align: center;
    padding: 24px;
    color: #9ca3af;
    font-size: 14px;
}

.file-list {
    max-height: 360px;
    overflow-y: auto;
}

.file-list-footer {
    border-top: 1px solid #e5e7eb;
    padding: 12px 16px;
    background: #fafafa;
}

.file-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.file-card:last-child {
    border-bottom: none;
}

.file-card:hover {
    background: #f9fafb;
}

.file-card.active {
    background: rgba(139, 92, 246, 0.06);
    border-left: 3px solid #8b5cf6;
}

.file-card-icon {
    font-size: 28px;
    color: #8b5cf6;
    flex-shrink: 0;
}

.file-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-card-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-card-meta {
    font-size: 12px;
    color: #9ca3af;
}

.file-card-remove {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.file-card-remove:hover {
    background: #fee2e2;
    color: #ef4444;
}

.file-card-remove .material-symbols-outlined {
    font-size: 18px;
}

.file-status {
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
}

.file-status.loading {
    color: #8b5cf6;
}

.file-status.error {
    color: #ef4444;
}

/* ===== Share Buttons ===== */
#shareBar { position: relative; }

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.share-btn:hover {
    transform: translateY(-2px) scale(1.1);
    border-color: #8b5cf6;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.2);
}

.share-btn .material-symbols-outlined { font-size: 25px; }
.share-btn .share-text { font-family: 'Sora', sans-serif; font-size: 23px; font-weight: 700; }
.share-btn.copied { background: #4caf50; color: #fff; border-color: #4caf50; }

#shareBar .share-btn[data-platform="copy"] { background: #7c3aed; color: #fff; border-color: #7c3aed; }
#shareBar .share-btn[data-platform="x"] { background: #1a1a1a; color: #fff; border-color: #444; }
#shareBar .share-btn[data-platform="facebook"] { background: #2563eb; color: #fff; border-color: #2563eb; }
#shareBar .share-btn[data-platform="reddit"] { background: #ea580c; color: #fff; border-color: #ea580c; }

.share-toast {
    position: absolute;
    top: -48px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #333;
    padding: 8px 18px;
    border-radius: var(--radius);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.share-toast.show { opacity: 1; }

/* ===== Footer ===== */
footer.gradient-bg {
    border-top-color: rgba(139, 92, 246, 0.2) !important;
}

footer .gradient-text {
    font-size: 24px;
    font-weight: 700;
}

/* ===== Color Picker Overlay ===== */
.color-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.color-picker-overlay.hidden {
    display: none;
}

.color-picker-overlay input[type="color"] {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 120px;
    height: 120px;
    margin-left: -60px;
    margin-top: -60px;
    opacity: 0;
    cursor: pointer;
}

@media (max-width: 640px) {
    .color-picker-overlay input[type="color"] {
        width: 160px;
        height: 160px;
        margin-left: -80px;
        margin-top: -80px;
    }
}

/* ===== Tool Grid (team.php) ===== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px 16px;
}

.tool-item {
    display: flex;
    flex-direction: column;
}

.tool-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #6b7280;
}

@media (max-width: 900px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    h1.gradient-text {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }

    .upload-zone {
        padding: 32px 16px;
    }

    .converter-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .converter-controls button {
        width: 100%;
    }

    .preset-bar {
        gap: 6px;
    }

    .preset-btn {
        padding: 6px 14px;
        font-size: 12px;
    }

    .custom-size-row {
        flex-direction: column;
        gap: 6px;
    }

    .custom-size-input {
        width: 100%;
        max-width: 200px;
    }

    .custom-size-sep {
        display: none;
    }
}
