/* ================================================================
   Sticker Manager — Front-end CSS
   Identidade: Capital Health — SF Pro Display, #1aebbb
   ================================================================ */

:root {
    --sm-green:       #1aebbb;
    --sm-green-dark:  #0fcc9e;
    --sm-green-light: #e8fdf8;
    --sm-white:       #ffffff;
    --sm-text:        #1a1a1a;
    --sm-muted:       #888888;
    --sm-border:      #e8e8e8;
    --sm-radius:      20px;
    --sm-radius-sm:   12px;
    --sm-font:        "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Grid */
.sm-grid {
    display: grid;
    gap: 20px;
    padding: 4px 0 24px;
    font-family: var(--sm-font);
}
.sm-cols-3 { grid-template-columns: repeat(3, 1fr); }
.sm-cols-2 { grid-template-columns: repeat(2, 1fr); }
.sm-cols-1 { grid-template-columns: 1fr; }

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

.sm-empty {
    color: var(--sm-muted);
    font-style: italic;
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 0;
    font-family: var(--sm-font);
}

/* Card */
.sm-card {
    background: var(--sm-white);
    border-radius: var(--sm-radius);
    border: 1px solid var(--sm-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: var(--sm-font);
}
.sm-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

.sm-card__thumb {
    position: relative;
    background: #f0f0f0;
    aspect-ratio: 7 / 10;
    overflow: hidden;
    border-radius: var(--sm-radius) var(--sm-radius) 0 0;
}
.sm-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.sm-card:hover .sm-card__thumb img { transform: scale(1.03); }
.sm-card__thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 13px;
}

.sm-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 10px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1;
    font-family: var(--sm-font);
}
.sm-badge--crop {
    background: var(--sm-green);
    color: #0a5c47;
}

.sm-card__body {
    padding: 16px 20px 10px;
    flex: 1;
}
.sm-card__title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 5px;
    color: var(--sm-text);
    line-height: 1.3;
    font-family: var(--sm-font);
}
.sm-card__cat {
    font-size: 13px;
    color: var(--sm-muted);
    font-family: var(--sm-font);
}

.sm-card__footer { padding: 12px 20px 20px; }

/* Botões */
.sm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    padding: 13px 20px;
    border-radius: var(--sm-radius-sm);
    border: none;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    width: 100%;
    text-align: center;
    line-height: 1;
    font-family: var(--sm-font);
    letter-spacing: -0.01em;
}
.sm-btn:active { transform: scale(0.97); }

.sm-btn--download,
.sm-btn--primary {
    background: linear-gradient(90deg, #1aebbb 0%, #0fcc9e 100%);
    color: #fff;
}
.sm-btn--download:hover,
.sm-btn--primary:hover { opacity: 0.88; }

.sm-btn--secondary {
    background: #f2f2f2;
    color: #444;
    border: 1px solid #e0e0e0;
}
.sm-btn--secondary:hover { background: #e8e8e8; }

/* Modais */
.sm-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    font-family: var(--sm-font);
}
.sm-modal--open { display: flex; }

.sm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
}

.sm-modal__box {
    position: relative;
    background: var(--sm-white);
    border-radius: var(--sm-radius);
    padding: 36px 32px 32px;
    max-width: 480px;
    width: calc(100% - 32px);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.15);
    z-index: 1;
}
.sm-modal__box--crop { max-width: 600px; }

.sm-modal__close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: #f2f2f2;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #888;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}
.sm-modal__close:hover { background: #e0e0e0; color: #333; }

.sm-modal__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--sm-text);
    padding-right: 40px;
    font-family: var(--sm-font);
    letter-spacing: -0.02em;
}
.sm-modal__subtitle {
    font-size: 14px;
    color: var(--sm-muted);
    margin: 0 0 24px;
    line-height: 1.6;
}
.sm-modal__cta { margin-top: 24px; }

/* Tutorial */
.sm-tutorial__steps {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.sm-tutorial__steps li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}
.sm-tutorial__num {
    background: linear-gradient(135deg, #1aebbb, #0fcc9e);
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.sm-tutorial__tip {
    font-size: 13px;
    color: #777;
    background: var(--sm-green-light);
    border-left: 3px solid var(--sm-green);
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    margin-top: 4px;
    line-height: 1.6;
}

/* Upload area */
.sm-upload-area {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: var(--sm-radius-sm);
    padding: 44px 20px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sm-upload-area:hover {
    border-color: var(--sm-green);
    background: var(--sm-green-light);
}
.sm-upload-area__inner {
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #888;
}
.sm-upload-area__inner svg { color: var(--sm-green); }
.sm-upload-area__inner p { font-size: 15px; font-weight: 600; color: #333; margin: 0; }
.sm-upload-area__inner span { font-size: 12px; color: #aaa; }

/* Cropper */
.sm-cropper-wrapper {
    width: 100%;
    min-height: 300px;
    max-height: 420px;
    overflow: hidden;
    border-radius: var(--sm-radius-sm);
    background: #111;
    margin-bottom: 16px;
    position: relative;
}
.sm-cropper-wrapper img {
    display: block;
    max-width: 100%;
    max-height: 420px;
}
.sm-crop-actions { display: flex; gap: 12px; }
.sm-crop-actions .sm-btn { flex: 1; }

/* Spinner */
.sm-processing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 48px 20px;
    color: var(--sm-muted);
    font-size: 14px;
}
.sm-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--sm-green);
    border-radius: 50%;
    animation: sm-spin 0.8s linear infinite;
}
@keyframes sm-spin { to { transform: rotate(360deg); } }

/* Reset */
.sm-grid *, .sm-modal * { box-sizing: border-box; }
