/* Frontend Styles */
.ai-humanizer-code-input {
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.ai-humanizer-code-input h3 {
    margin-top: 0;
    text-align: center;
}

.ai-humanizer-code-input .form-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ai-humanizer-code-input input[type="text"] {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

.ai-humanizer-code-input .button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background-color: #0073aa;
    color: white;
    cursor: pointer;
    font-size: 16px;
}

.ai-humanizer-code-input .button:hover {
    background-color: #005a87;
}

.ai-humanizer-code-input .message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
}

.ai-humanizer-code-input .message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ai-humanizer-code-input .message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Dashboard Styles */
.ai-humanizer-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

.ai-humanizer-dashboard .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ai-humanizer-dashboard .dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.ai-humanizer-dashboard .dashboard-header h1 {
    margin: 0 0 20px 0;
    font-size: 2.5em;
}

.ai-humanizer-dashboard .code-info {
    font-size: 1.2em;
}

.ai-humanizer-dashboard .code-value {
    background: rgba(255,255,255,0.2);
    padding: 5px 10px;
    border-radius: 4px;
    margin: 0 10px;
    font-weight: bold;
}

.ai-humanizer-dashboard .credits-info {
    background: rgba(255,255,255,0.2);
    padding: 5px 10px;
    border-radius: 4px;
    margin-left: 10px;
}

.ai-humanizer-dashboard .dashboard-content {
    display: grid;
    gap: 30px;
}

.ai-humanizer-dashboard section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ai-humanizer-dashboard h2 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.ai-humanizer-dashboard .form-group {
    margin-bottom: 20px;
}

.ai-humanizer-dashboard label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.ai-humanizer-dashboard textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
}

.ai-humanizer-dashboard textarea:focus {
    border-color: #667eea;
    outline: none;
}

.ai-humanizer-dashboard .button {
    background: #667eea;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.ai-humanizer-dashboard .button:hover {
    background: #5a6fd8;
}

.ai-humanizer-dashboard #word-count {
    color: #667eea;
    font-weight: bold;
}

.ai-humanizer-dashboard .document-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.ai-humanizer-dashboard .document-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ai-humanizer-dashboard .document-id {
    font-family: monospace;
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.ai-humanizer-dashboard .document-meta {
    color: #666;
    font-size: 0.9em;
}

.ai-humanizer-dashboard .document-meta span {
    margin-right: 15px;
}

.ai-humanizer-dashboard .processed-text .toggle-text {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    margin-top: 10px;
}

.ai-humanizer-dashboard .processed-text .text-content {
    margin-top: 10px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    white-space: pre-wrap;
}

.ai-humanizer-dashboard .usage-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.ai-humanizer-dashboard .usage-table th,
.ai-humanizer-dashboard .usage-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.ai-humanizer-dashboard .usage-table th {
    background: #f8f9fa;
    font-weight: bold;
}

.ai-humanizer-dashboard #document-status {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
}

.ai-humanizer-dashboard #document-status h2 {
    border-bottom-color: #ffc107;
}

.ai-humanizer-dashboard .status-indicator {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
}

.ai-humanizer-dashboard .status-pending {
    background: #fff3cd;
    color: #856404;
}

.ai-humanizer-dashboard .status-processing {
    background: #cce5ff;
    color: #004085;
}

.ai-humanizer-dashboard .status-completed {
    background: #d4edda;
    color: #155724;
}

.ai-humanizer-dashboard .status-failed {
    background: #f8d7da;
    color: #721c24;
}

/* Loading spinner */
.ai-humanizer-dashboard .loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .ai-humanizer-dashboard .container {
        padding: 10px;
    }

    .ai-humanizer-dashboard .dashboard-header {
        padding: 20px;
    }

    .ai-humanizer-dashboard .dashboard-header h1 {
        font-size: 2em;
    }

    .ai-humanizer-dashboard section {
        padding: 20px;
    }

    .ai-humanizer-dashboard .code-info {
        font-size: 1em;
    }

    .ai-humanizer-dashboard .document-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Result Page Styles */
.ai-humanizer-result {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

.ai-humanizer-result .result-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.ai-humanizer-result .result-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
}

.ai-humanizer-result .section-card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.ai-humanizer-result .section-card h2 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.ai-humanizer-result .status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

.ai-humanizer-result .status-processing {
    background: #cce5ff;
    color: #004085;
}

.ai-humanizer-result .status-completed {
    background: #d4edda;
    color: #155724;
}

.ai-humanizer-result .status-failed {
    background: #f8d7da;
    color: #721c24;
}

.ai-humanizer-result .document-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.ai-humanizer-result .info-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
}

.ai-humanizer-result .info-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.ai-humanizer-result .info-value {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.ai-humanizer-result .loading-spinner {
    text-align: center;
    padding: 60px 20px;
}

.ai-humanizer-result .loading-spinner::after {
    content: "";
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.ai-humanizer-result textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ai-humanizer-result textarea:focus {
    border-color: #667eea;
    outline: none;
}

@media (max-width: 768px) {
    .ai-humanizer-result .result-header h1 {
        font-size: 2em;
    }

    .ai-humanizer-result .section-card {
        padding: 20px;
    }

    .ai-humanizer-result .document-info {
        grid-template-columns: 1fr;
    }
}