/* =====================================================================
   Riviu Sugestão - Public Styles
   ===================================================================== */

/* Container */
.riviu-sugestao-container {
    max-width: 580px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.riviu-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Form Wrapper */
.riviu-sugestao-form-wrapper {
    background: #fff;
    border-radius: 16px;
    padding: 20px 24px 30px; /* Reduced top padding */
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 6px 24px rgba(0,0,0,0.06);
}

/* Header */
.riviu-sugestao-header {
    text-align: center;
    margin-bottom: 20px;
    margin-top: 0;
    padding-top: 0;
}

.riviu-sugestao-title {
    font-size: 20px; /* Slightly smaller to fit better */
    font-weight: 700;
    margin: 0 0 4px 0;
    line-height: 1.2;
    color: #1a1a2e;
}

.riviu-sugestao-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

/* Form */
.riviu-sugestao-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.riviu-sugestao-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.riviu-sugestao-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.riviu-sugestao-field label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.riviu-sugestao-field label .required {
    color: #ef4444;
}

.riviu-sugestao-field input[type="text"],
.riviu-sugestao-field input[type="url"] {
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    color: #1f2937;
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.riviu-sugestao-field input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
    background: #fff;
}

.riviu-sugestao-field input.has-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

.riviu-sugestao-hint {
    font-size: 12px;
    color: #9ca3af;
}

.riviu-sugestao-field-error {
    font-size: 12px;
    color: #ef4444;
    min-height: 0;
}

.riviu-sugestao-global-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #dc2626;
    text-align: center;
}

/* Upload Area */
.riviu-sugestao-upload-area {
    border: none;
    border-radius: 0;
    cursor: default;
    background: transparent;
    overflow: visible;
    position: relative;
    padding: 0;
    margin: 0;
}

.riviu-sugestao-upload-area:hover,
.riviu-sugestao-upload-area.dragover {
    border-color: transparent;
    background: transparent;
}

.riviu-sugestao-upload-placeholder {
    display: none !important;
}

.riviu-sugestao-upload-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 10px 0;
    background: transparent;
}

.riviu-sugestao-upload-preview img {
    max-width: 100%;
    max-height: 220px;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
}

.riviu-sugestao-remove-img {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.riviu-sugestao-remove-img:hover {
    background: rgba(220,38,38,0.9);
}

/* Submit Button */
.riviu-sugestao-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}

.riviu-sugestao-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}

.riviu-sugestao-submit:active {
    transform: translateY(0);
}

.riviu-sugestao-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.riviu-spinner {
    animation: riviu-spin 0.8s linear infinite;
}

@keyframes riviu-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Success */
.riviu-sugestao-success {
    text-align: center;
    padding: 48px 32px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 6px 24px rgba(0,0,0,0.06);
}

.riviu-sugestao-success-icon {
    margin-bottom: 16px;
}

.riviu-sugestao-success h3 {
    font-size: 22px;
    color: #1a1a2e;
    margin: 0 0 8px;
}

.riviu-sugestao-success p {
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 24px;
    line-height: 1.5;
}

.riviu-sugestao-new-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.riviu-sugestao-new-btn:hover {
    background: #e5e7eb;
}

/* Crop Modal */
.riviu-sugestao-crop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.riviu-sugestao-crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.65);
}

.riviu-sugestao-crop-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 560px;
    width: 92%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.riviu-sugestao-crop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.riviu-sugestao-crop-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.riviu-sugestao-crop-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.riviu-sugestao-crop-body {
    flex: 1;
    overflow: hidden;
}

.riviu-sugestao-crop-container {
    width: 100%;
    height: 340px;
    background: #1a1a2e;
}

.riviu-sugestao-crop-container img {
    display: block;
    max-width: 100%;
}

.riviu-sugestao-crop-toolbar {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-top: 1px solid #f0f0f0;
    background: #f9fafb;
}

.riviu-crop-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.riviu-crop-tool svg {
    flex-shrink: 0;
    display: block;
    stroke: #6b7280 !important;
    fill: none !important;
}

.riviu-crop-tool:hover {
    background: #eef2ff;
    color: #4f46e5;
    border-color: #a5b4fc;
    box-shadow: 0 1px 3px rgba(99,102,241,0.12);
}

.riviu-crop-tool:hover svg {
    stroke: #4f46e5 !important;
}

.riviu-crop-tool:active {
    transform: scale(0.97);
}

.riviu-sugestao-crop-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #f0f0f0;
}

.riviu-sugestao-crop-cancel-btn {
    padding: 10px 20px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.riviu-sugestao-crop-cancel-btn:hover {
    background: #f3f4f6;
}

.riviu-sugestao-crop-confirm-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.riviu-sugestao-crop-confirm-btn:hover {
    opacity: 0.9;
}

.riviu-sugestao-crop-confirm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =====================================================================
   GRID
   ===================================================================== */

.riviu-sugestoes-grid-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.riviu-sugestoes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.riviu-sugestao-grid-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 3px 12px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}

.riviu-sugestao-grid-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.riviu-sugestao-grid-image {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f3f4f6;
}

.riviu-sugestao-grid-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.riviu-sugestao-grid-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
}

.riviu-sugestao-grid-link {
    padding: 12px 16px;
    text-align: center;
}

.riviu-sugestao-grid-link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6366f1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s;
}

.riviu-sugestao-grid-link a:hover {
    color: #4f46e5;
}

.riviu-sugestoes-grid-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 15px;
}

.riviu-sugestoes-grid-more {
    text-align: center;
    margin-top: 24px;
}

.riviu-sugestoes-load-more {
    padding: 12px 32px;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.riviu-sugestoes-load-more:hover {
    background: #f9fafb;
    border-color: #6366f1;
    color: #6366f1;
}

/* =====================================================================
   HERO IMAGE
   ===================================================================== */

.riviu-sugestao-hero {
    text-align: center;
    margin-bottom: 20px;
}

.riviu-sugestao-hero img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.4);
    margin-bottom: 8px;
}

.riviu-sugestao-hero-text {
    margin-top: 8px;
}

.riviu-sugestao-hero-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: inherit;
    line-height: 1.2;
}

.riviu-sugestao-hero-subtitle {
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.85;
    line-height: 1.3;
    color: inherit;
}

/* =====================================================================
   TABS
   ===================================================================== */

.riviu-sugestao-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}

.riviu-sugestao-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.riviu-sugestao-tab svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.riviu-sugestao-tab.active {
    background: #fff;
    color: #1e293b;
    border-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.riviu-sugestao-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.riviu-sugestao-tab-content {
    display: none;
}

.riviu-sugestao-tab-content.active {
    display: block;
}

/* =====================================================================
   ATTACH BUTTON (explicit upload)
   ===================================================================== */

.riviu-sugestao-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    margin-top: 4px;
}

.riviu-sugestao-attach-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* =====================================================================
   SUCCESS ACTIONS
   ===================================================================== */

.riviu-sugestao-success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.riviu-sugestao-minhas-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.riviu-sugestao-minhas-btn:hover {
    opacity: 0.85;
}

/* =====================================================================
   MINHAS SUGESTÕES
   ===================================================================== */

.riviu-sugestao-minhas-wrapper {
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 6px 24px rgba(0,0,0,0.06);
}

.riviu-sugestao-minhas-header {
    text-align: center;
    margin-bottom: 24px;
}

.riviu-sugestao-minhas-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px;
}

.riviu-sugestao-minhas-header p {
    font-size: 14px;
    color: #9ca3af;
    margin: 0;
}

.riviu-sugestao-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    color: #9ca3af;
    font-size: 14px;
}

.riviu-minhas-empty {
    text-align: center;
    padding: 30px 20px;
    color: #9ca3af;
}

.riviu-minhas-empty p {
    font-size: 15px;
    margin: 12px 0 16px;
}

.riviu-sugestao-tab-link {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.riviu-sugestao-tab-link:hover {
    opacity: 0.85;
}

/* Minha Item */
.riviu-minha-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid #f0f0f1;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

.riviu-minha-item:hover {
    border-color: #d1d5db;
}

.riviu-minha-item-img {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f3f4f6;
}

.riviu-minha-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.riviu-minha-item-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.riviu-minha-item-info {
    flex: 1;
    min-width: 0;
}

.riviu-minha-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.riviu-minha-item-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6366f1;
    text-decoration: none;
    margin-bottom: 4px;
}

.riviu-minha-item-link:hover {
    text-decoration: underline;
}

.riviu-minha-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.riviu-minha-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.riviu-minha-badge.badge-nova { background: #e8f4fd; color: #0a6abf; }
.riviu-minha-badge.badge-analisando { background: #fff3e0; color: #e65100; }
.riviu-minha-badge.badge-testado { background: #e8f5e9; color: #2e7d32; }
.riviu-minha-badge.badge-recusado { background: #fce4ec; color: #c62828; }

.riviu-minha-date {
    font-size: 11px;
    color: #9ca3af;
}

.riviu-minha-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.riviu-minha-edit-btn,
.riviu-minha-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
}

.riviu-minha-edit-btn {
    color: #6366f1;
}

.riviu-minha-edit-btn svg {
    stroke: #6366f1 !important;
    fill: none !important;
    flex-shrink: 0;
}

.riviu-minha-delete-btn {
    color: #ef4444;
}

.riviu-minha-delete-btn svg {
    stroke: #ef4444 !important;
    fill: none !important;
    flex-shrink: 0;
}

.riviu-minha-edit-btn:hover {
    background: #f0f0ff;
    border-color: #6366f1;
}

.riviu-minha-delete-btn:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.riviu-minha-locked {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.riviu-minha-locked svg {
    stroke: #9ca3af !important;
    fill: none !important;
}

/* Edit Modal Body */
.riviu-sugestao-edit-minha-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.riviu-sugestao-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.riviu-edit-minha-img-preview {
    text-align: center;
}

.riviu-edit-minha-img-preview img {
    max-width: 100%;
    max-height: 140px;
    border-radius: 8px;
    object-fit: contain;
}

.riviu-edit-attach-btn {
    width: 100%;
    justify-content: center;
}

/* Responsive Grid */
@media (max-width: 768px) {
    .riviu-sugestoes-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px;
    }
}

@media (max-width: 480px) {
    .riviu-sugestao-container {
        padding: 12px;
    }

    .riviu-sugestao-form-wrapper {
        padding: 24px 20px;
    }

    .riviu-sugestao-row {
        grid-template-columns: 1fr;
    }

    .riviu-sugestoes-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .riviu-sugestao-crop-container {
        height: 260px;
    }

    .riviu-sugestao-tabs {
        flex-wrap: wrap;
        gap: 6px;
    }

    .riviu-sugestao-tab {
        font-size: 12px;
        padding: 8px 16px;
    }

    .riviu-sugestao-minhas-wrapper {
        padding: 20px 16px;
    }

    .riviu-minha-item {
        flex-wrap: wrap;
    }

    .riviu-minha-item-info {
        min-width: calc(100% - 80px);
    }

    .riviu-sugestao-success-actions {
        flex-direction: column;
        align-items: center;
    }

    .riviu-sugestao-crop-toolbar {
        flex-wrap: wrap;
        gap: 5px;
        padding: 8px 10px;
    }

    .riviu-crop-tool {
        padding: 7px 12px;
        font-size: 12px;
        gap: 4px;
    }

    .riviu-crop-tool svg {
        width: 14px;
        height: 14px;
    }

    .riviu-minha-item-actions {
        flex-wrap: wrap;
    }

    .riviu-minha-edit-btn,
    .riviu-minha-delete-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
}
