/* Layout Base */
.app-body {
    height: 100vh;
    overflow: hidden;
}

.app-layout {
    display: flex;
    height: 100vh;
    padding: 24px;
    gap: 24px;
}

.sidebar {
    width: 320px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 32px 0 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 28px;
}

.sidebar .tagline {
    margin-bottom: 32px;
}

.section-title {
    font-size: 0.7rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
    margin-top: 32px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(61, 90, 254, 0.2), transparent);
}

.upload-v2 {
    border: 1.5px dashed var(--border);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text);
}

/* FontTool Specific Styles */
.font-tool-container {
    width: 100%;
    margin: 0;
    padding: 32px;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 32px;
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-height: calc(100vh - 80px);
}

.mode-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--border);
    width: fit-content;
}

.mode-btn {
    padding: 10px 24px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.mode-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--glow);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Workspace Layout */
.tool-workspace {
    display: flex;
    gap: 32px;
    flex: 1;
    align-items: stretch;
}

.workspace-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent flex overflow */
}

.workspace-right {
    width: 320px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    flex-shrink: 0;
}

.input-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

textarea {
    width: 100%;
    flex: 1;
    min-height: 400px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: #fff;
    padding: 24px;
    font-family: var(--font);
    font-size: 1.1rem;
    line-height: 1.6;
    resize: none;
    transition: all 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.3);
}

.input-area.hidden {
    display: none;
}

.animation-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed var(--border);
    border-radius: 24px;
    transition: all 0.5s ease;
}

.animation-area.hidden {
    display: none;
}

/* Preset Tags */
.preset-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.preset-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preset-tag:hover {
    background: rgba(61, 90, 254, 0.15);
    border-color: var(--primary);
    color: #fff;
}

.preset-tag .count {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Font Details in Sidebar */
.file-info {
    margin-top: 24px;
    padding: 20px;
    background: rgba(61, 90, 254, 0.08);
    border: 1px solid rgba(61, 90, 254, 0.2);
    border-radius: 16px;
    display: none;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    line-height: 1.4;
}

.info-label {
    color: var(--text-dim);
}

.info-value {
    color: #fff;
    font-weight: 600;
    text-align: right;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Post-upload state */
.upload-v2.has-file {
    background: rgba(61, 90, 254, 0.15);
    border-style: solid;
    border-color: var(--primary);
    padding: 16px 20px;
    height: auto;
    min-height: unset;
}

.upload-v2.has-file span.material-symbols-outlined {
    color: var(--primary);
    font-size: 20px;
}

.upload-v2.has-file span:not(.material-symbols-outlined) {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Custom Select Styles */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "expand_more";
    font-family: "Material Symbols Outlined";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-dim);
    font-size: 1.2rem;
}

.select-wrapper select {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.3s ease;
}

.select-wrapper select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(61, 90, 254, 0.2);
}

.action-bar {
    display: flex;
    gap: 16px;
}

.download-card {
    padding: 24px;
    background: linear-gradient(
        135deg,
        rgba(0, 229, 255, 0.15),
        rgba(61, 90, 254, 0.15)
    );
    border: 1px solid var(--accent);
    border-radius: 20px;
    display: none;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 1200px) {
    .tool-workspace {
        flex-direction: column;
    }
    .workspace-right {
        width: 100%;
    }
    textarea {
        min-height: 300px;
    }
}
