/* Tool Specific Styles */
.tool-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.input-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-header {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 5px;
}

.input-row {
    display: flex;
    gap: 16px;
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--primary-blue);
}

/* Presets */
.presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.ratio-display {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: var(--bg-body);
    padding: 8px;
    border-radius: var(--radius-sm);
}

.highlight {
    font-weight: 700;
    color: var(--primary-blue);
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: -5px;
}

/* Visual Preview */
.preview-box {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}

.preview-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.preview-canvas {
    width: 100%;
    height: 300px;
    background-color: var(--bg-body);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.aspect-box {
    width: 200px; /* Base width */
    height: 112px; /* Base height (16:9 approx) */
    background: linear-gradient(135deg, var(--primary-blue), #1e40af);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
}

/* Shared Modal & Toast */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px); transition: all 0.3s ease;
}
.modal-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.modal-content {
    background: var(--bg-surface); width: 90%; max-width: 400px;
    padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border-color);
}
.modal-header { display: flex; justify-content: space-between; margin-bottom: 16px; }
.modal-header h3 { font-size: 1.2rem; font-weight: 700; color: var(--text-main); }
.modal-body p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 12px; }
.icon-button { background: none; border: none; padding: 6px; cursor: pointer; color: var(--text-muted); }

@media (max-width: 600px) {
    .calc-grid { grid-template-columns: 1fr; }
}