/* Advanced Text & Document Counter Layout & Theme Rules */
*, *::before, *::after {
    box-sizing: border-box;
}

.atc-wrapper {
    background-color: #F5F5F7;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #1A1A1A;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* Header Bar Settings */
.atc-header {
    background-color: #00E5FF;
    color: #1A1A1A;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 25px;
}

.atc-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #1A1A1A !important;
}

/* Two Column Layout Split */
.atc-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

@media (min-width: 992px) {
    .atc-container {
        display: grid;
        grid-template-columns: 1.2fr 1fr;
    }
}

/* Input Elements styling */
.atc-input-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.atc-upload-zone {
    border: 2px dashed #00E5FF;
    background-color: #FFFFFF;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.atc-upload-zone:hover, .atc-upload-zone.dragover {
    background-color: #E6FCFF;
    border-color: #00B3CC;
}

.atc-upload-icon {
    width: 40px;
    height: 40px;
    color: #00E5FF;
    margin-bottom: 10px;
}

.atc-browse-btn {
    color: #00B3CC;
    text-decoration: underline;
    font-weight: 600;
}

.atc-formats-label {
    display: block;
    font-size: 11px;
    color: #666666;
    margin-top: 5px;
}

/* Textarea Layout */
.atc-textarea-container {
    flex-grow: 1;
    min-height: 250px;
    display: flex;
}

#atc-textarea {
    width: 100%;
    min-height: 250px;
    padding: 15px;
    border: 1px solid #D1D1D6;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background-color: #FFFFFF;
    color: #1A1A1A;
}

#atc-textarea:focus {
    outline: none;
    border-color: #00E5FF;
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.2);
}

/* Buttons configuration */
.atc-actions-row {
    display: flex;
    gap: 12px;
}

.atc-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.atc-btn-primary {
    background-color: #00E5FF;
    color: #1A1A1A;
    flex-grow: 2;
}

.atc-btn-primary:hover:not(:disabled) {
    background-color: #00B3CC;
}

.atc-btn-primary:disabled {
    background-color: #CCCCCC;
    color: #666666;
    cursor: not-allowed;
}

.atc-btn-secondary {
    background-color: #E5E5EA;
    color: #1A1A1A;
    flex-grow: 1;
}

.atc-btn-secondary:hover {
    background-color: #D1D1D6;
}

/* Dashboard Side Layout */
.atc-dashboard {
    background-color: #FFFFFF;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #E5E5EA;
}

.atc-dashboard-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
    border-bottom: 2px solid #F5F5F7;
    padding-bottom: 10px;
}

.atc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 480px) and (max-width: 991px) {
    .atc-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.atc-card {
    background-color: #F8F9FA;
    border: 1px solid #E5E5EA;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
}

.atc-val {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #1A1A1A;
    margin-bottom: 4px;
}

.atc-lbl {
    display: block;
    font-size: 11px;
    color: #666666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.atc-insights {
    margin-top: 20px;
    background-color: #E6FCFF;
    border-left: 4px solid #00E5FF;
    border-radius: 0 6px 6px 0;
    padding: 12px;
}

.atc-insight-item {
    font-size: 13px;
    margin-bottom: 6px;
}

.atc-insight-item:last-child {
    margin-bottom: 0;
}

/* Status and Async Spinners */
.atc-status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #FFF3CD;
    border: 1px solid #FFEBAA;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
}

.atc-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #1A1A1A;
    border-top-color: transparent;
    border-radius: 50%;
    animation: atc-spin 0.8s linear infinite;
}

@keyframes atc-spin {
    to { transform: rotate(360deg); }
}
