/* Social Media Safe Zone Tool — custom styles */

/* Grid layout */
.tool-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

/* Main card */
.main-card {
    background: #fff;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Canvas container */
.canvas-container {
    position: relative;
    width: 100%;
    background: #f3f4f6;
    border-radius: 8px;
    overflow: hidden;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-container canvas {
    max-width: 100%;
    height: auto;
    display: none;
}

/* Placeholder */
.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #9ca3af;
    padding: 2rem;
    text-align: center;
}

.placeholder-icon {
    font-size: 2.5rem;
}

/* Info box */
.info-box {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #1e40af;
    line-height: 1.5;
}

/* Legend */
.overlay-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: #374151;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Control card */
.control-card {
    background: #fff;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.control-group {
    margin-bottom: 1rem;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.35rem;
}

.control-group select,
.control-group input[type="range"] {
    width: 100%;
}

.control-group select {
    padding: 0.45rem 0.6rem;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    background: #f9fafb;
    color: #111827;
    font-size: 0.875rem;
}

.opacity-value {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 0.25rem;
    text-align: right;
}

/* File upload */
.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: #f3f4f6;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    transition: background 0.2s, border-color 0.2s;
}

.file-upload-label:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.55rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s, opacity 0.2s;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

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

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e0e6ed;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* FAQ */
.faq {
    margin-top: 2.5rem;
}

.faq-item {
    border: 1px solid #e0e6ed;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    background: #f9fafb;
    color: #111827;
}

.faq-answer {
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.6;
    border-top: 1px solid #e0e6ed;
    display: none;
}

.faq-item:hover .faq-question {
    background: #f3f4f6;
}

/* Section title */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

/* Related */
.related {
    margin-top: 2rem;
}

.related-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.related-link {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background 0.2s;
}

.related-link:hover {
    background: #dbeafe;
}

/* Dark mode */
html[data-theme="dark"] .main-card,
html[data-theme="dark"] .control-card {
    background: #1f2937;
    border-color: #374151;
}

html[data-theme="dark"] .canvas-container {
    background: #111827;
}

html[data-theme="dark"] .placeholder {
    color: #6b7280;
}

html[data-theme="dark"] .info-box {
    background: #1e3a5f;
    border-color: #1d4ed8;
    color: #93c5fd;
}

html[data-theme="dark"] .legend-item {
    color: #d1d5db;
}

html[data-theme="dark"] .control-group label {
    color: #d1d5db;
}

html[data-theme="dark"] .control-group select {
    background: #111827;
    color: #f9fafb;
    border-color: #374151;
}

html[data-theme="dark"] .file-upload-label {
    background: #374151;
    border-color: #4b5563;
    color: #d1d5db;
}

html[data-theme="dark"] .btn-secondary {
    background: #374151;
    color: #d1d5db;
    border-color: #4b5563;
}

html[data-theme="dark"] .faq-item {
    border-color: #374151;
}

html[data-theme="dark"] .faq-question {
    background: #111827;
    color: #f9fafb;
}

html[data-theme="dark"] .faq-answer {
    color: #d1d5db;
    border-color: #374151;
}

html[data-theme="dark"] .section-title {
    color: #f9fafb;
}

html[data-theme="dark"] .related-link {
    background: #1e3a5f;
    color: #93c5fd;
    border-color: #1d4ed8;
}
