/* =========================================
   1. Geral
   ========================================= */
#image-converter,
#subscription-form,
#cancel-subscription {
    max-width: 840px;
    margin: 20px auto;
    padding: 20px;
    background-color: #f9fafb;
    border: 1px solid #cbd5e1; /* Increased contrast border */
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    color: #334155; /* Base text darker for readability */
}

h2,
h3 {
    color: #257a6e; /* Accessible Teal >4.5:1 contrast */
    margin-bottom: 15px;
}

/* Label */
label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: bold;
    color: #257a6e; /* Accessible Teal */
}

/* Inputs */
input[type="file"],
select {
    width: 100%;
    padding: 8px;
    border: 1px solid #718096; /* Contrast compliant border */
    background-color: #fff;
    color: #1a202c; /* High contrast text inside inputs */
    border-radius: 4px;
    box-sizing: border-box;
}

input[type="file"]:focus,
select:focus {
    border-color: #257a6e;
    outline: 2px solid #257a6e;
    outline-offset: 1px;
}

/* =========================================
   2. Botões
   ========================================= */
input[type="submit"],
button,
.ic-button {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #257a6e; /* Accessible Teal */
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s, transform 0.2s;
    text-decoration: none;
    display: inline-block;
}

input[type="submit"]:hover,
button:hover,
.ic-button:hover {
    background-color: #1d6158; /* Darker on hover */
}

.ic-button:hover {
    transform: scale(1.05);
}

/* =========================================
   3. Área de Drag and Drop
   ========================================= */
#drag-and-drop-area,
.ic-drag-drop-area {
    border: 2px dashed #718096; /* Increased contrast */
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
    margin-bottom: 15px;
}

#drag-and-drop-area:hover,
.ic-drag-drop-area.ic-dragover {
    background-color: #f0fdfa;
    border-color: #257a6e;
}

/* A label de texto dentro do drag n drop */
.ic-drop-text {
    cursor: pointer;
    color: #334155;
    font-weight: 500;
}

/* =========================================
   4. Container de Planos
   ========================================= */
.ic-plans {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

/* Box de Plano */
.ic-plan {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    max-width: 350px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.ic-plan:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ic-plan-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
}

.ic-plan p {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 16px;
}

/* =========================================
   5. Mensagens de Feedback
   ========================================= */
#cancel-subscription-message,
#subscription-success,
#subscription-canceled {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    font-size: 16px;
    text-align: center;
}

#cancel-subscription-message.success,
#subscription-success {
    background-color: #f0fdfa;
    color: #115e59;
    border: 1px solid #ccfbf1;
}

#cancel-subscription-message.error,
#subscription-canceled {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* =========================================
   6. Spinner de Carregamento
   ========================================= */
#loading-spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 8px solid #f3f3f3;
    border-top: 8px solid #257a6e;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
    z-index: 9999;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================
   7. Modal
   ========================================= */
.ic-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.ic-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #64748b;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    text-align: center;
    overflow: hidden;
}

.ic-close {
    color: #64748b;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 15px;
}

.ic-close:hover,
.ic-close:focus {
    color: #000;
    text-decoration: none;
}

#ic-uploads-list ul {
    list-style-type: none;
    padding: 0;
}

/* =========================================
   8. Dashboard do Usuário
   ========================================= */
#user-dashboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.ic-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    width: 100%;
    margin-bottom: 20px;
}

.ic-stat-box {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.ic-stat-box.full-width {
    grid-column: 1 / -1;
}

.ic-dashboard-table {
    width: 100%;
    max-width: 500px;
    border-collapse: collapse;
    border-radius: 11px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ic-dashboard-table th,
.ic-dashboard-table td {
    border: 1px solid #cbd5e1;
    padding: 12px;
    text-align: center;
}

.ic-dashboard-table th {
    background-color: #257a6e;
    color: #ffffff;
    font-weight: bold;
}

.ic-dashboard-table tr:nth-child(even) {
    background-color: #f8fafc;
}

/* =========================================
   11. Botão de Visualizar Uploads e Download
   ========================================= */
.ic-view-uploads-button {
    color: #257a6e;
    background: none;
    border: 2px solid #257a6e;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
.ic-view-uploads-button:hover {
    background-color: #257a6e;
    color: #fff;
}
.ic-view-uploads-button span {
    color: inherit;
    font-weight: bold;
}

/* =========================================
   New: Selectors & File Lists
   ========================================= */
.ic-format-selectors {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 15px;
    margin-bottom: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.ic-form-group {
    flex: 1;
    text-align: left;
}

.ic-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #718096;
    border-radius: 6px;
    background: #fff;
}

.ic-arrow-divider {
    font-size: 24px;
    color: #257a6e;
    padding-bottom: 5px;
}

/* Optimized File List */
.ic-upload-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    margin-bottom: 8px;
    border-radius: 5px;
    flex-wrap: wrap;
}

.ic-thumb-box img {
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    width: 60px;
    height: 60px;
    object-fit: cover;
    background: #f1f5f9;
}

.ic-info-box {
    flex-grow: 1;
    text-align: left;
    padding-left: 15px;
}
.ic-info-box span {
    font-weight: 500;
    color: #1e293b;
    word-break: break-all;
}

.ic-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

/* Small Button styles for list actions */
a.ic-btn-sm, 
button.ic-btn-sm {
    padding: 6px 12px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    height: auto !important;
    margin: 0 !important;
    border-radius: 4px;
    text-transform: none;
    font-weight: normal;
}

a.ic-btn-sm { background-color: #257a6e; color: #fff !important; }
a.ic-btn-sm:hover { background-color: #1d6158; }

button.ic-btn-del {
    background-color: #dc2626; /* high contrast red */
}
button.ic-btn-del:hover {
    background-color: #b91c1c;
}

/* Focus styles for Accessibility */
:focus {
    outline: 2px solid #257a6e;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .ic-format-selectors {
        flex-direction: column;
        align-items: stretch;
    }
    .ic-arrow-divider {
        display: none; /* Hide arrow on mobile to save vertical space */
    }
}
#ic-private-mode-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: 80%;
    max-width: 500px;
    background-color: #fee2e2;
    border: 2px solid #ef4444;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}

#ic-private-mode-overlay p {
    color: #b91c1c;
    font-weight: bold;
    font-size: 16px;
    margin: 0;
}

/* Blur filter for the underlying form content when blocked */
.ic-container-box {
    position: relative; /* ensure overlay positioning works */
}

.ic-blurred form, 
.ic-blurred #uploaded-files, 
.ic-blurred #daily-limit-message {
    filter: blur(5px);
    pointer-events: none; /* Disables interaction visually */
    opacity: 0.5;
    transition: all 0.3s ease;
}
#ic-private-mode-overlay,
.ic-noscript-warning {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: 80%;
    max-width: 500px;
    background-color: #fee2e2;
    border: 2px solid #ef4444;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}

/* Specific fix for NoScript warning to appear properly within flow if JS is off */
.ic-noscript-warning {
    position: relative;
    transform: none;
    left: auto;
    top: auto;
    margin: 20px auto;
}

#ic-private-mode-overlay p,
.ic-noscript-warning p {
    color: #b91c1c;
    font-weight: bold;
    font-size: 16px;
    margin: 0;
}

/* Blur filter */
.ic-container-box { position: relative; }
.ic-blurred form, 
.ic-blurred #uploaded-files, 
.ic-blurred #daily-limit-message {
    filter: blur(5px);
    pointer-events: none;
    opacity: 0.5;
    transition: all 0.3s ease;
}