/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

#compliance-select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 180px;
    background: white;
    transition: border-color 0.2s;
}

#compliance-select:focus {
    outline: none;
    border-color: #667eea;
}

/* Checkbox styling */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #2c3e50;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Button styles */
.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #48bb78;
    color: white;
}

.btn-secondary:hover {
    background: #38a169;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #666;
    border: 2px solid #ddd;
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #999;
    transform: translateY(-2px);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1rem;
}

/* Text areas */
.text-areas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.text-section {
    display: flex;
    flex-direction: column;
}

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

.text-header h3 {
    color: #2c3e50;
    font-size: 1.1rem;
}

.text-counter {
    font-size: 0.8rem;
    color: #666;
}

.output-actions {
    display: flex;
    gap: 8px;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

textarea::placeholder {
    color: #999;
}

#output-text {
    background: #f8f9fa;
}

/* Analysis section */
.analysis-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.analysis-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

#analysis-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.analysis-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #ddd;
    text-align: center;
}

.analysis-item h4 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.analysis-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.category-tag {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Loading spinner */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Error message */
.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-icon {
    font-size: 1.2rem;
}

/* Footer */
footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    color: #666;
    font-size: 0.9rem;
}

.footer-icon {
    color: #48bb78;
    margin-right: 5px;
}

.footer-links {
    margin-top: 10px;
}

.footer-links a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #5a67d8;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .button-group {
        justify-content: center;
    }
    
    .text-areas {
        grid-template-columns: 1fr;
    }
    
    .text-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .output-actions {
        justify-content: center;
    }
    
    #analysis-content {
        grid-template-columns: 1fr;
    }
}

/* Success animation */
.success-flash {
    animation: flash-success 0.5s ease-in-out;
}

@keyframes flash-success {
    0% { background-color: #c6f6d5; }
    100% { background-color: transparent; }
}