/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 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;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header h1 i {
    margin-right: 15px;
    color: #ffd700;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.main-content {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 30px;
}

.flash-message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

.flash-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.flash-message i {
    margin-right: 10px;
    font-size: 1.2rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Upload Section */
.upload-section {
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 1rem;
}

.form-label i {
    margin-right: 8px;
    color: #667eea;
}

.form-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* File Input */
.file-label {
    display: block;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input-wrapper {
    border: 3px dashed #e1e5e9;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    position: relative;
}

.file-input-wrapper:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.file-input-wrapper i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 15px;
    display: block;
}

.file-text {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.file-hint {
    display: block;
    font-size: 0.9rem;
    color: #666;
}

.file-input-wrapper.dragover {
    border-color: #667eea;
    background: #f0f2ff;
    transform: scale(1.02);
}

#file {
    display: none;
}

.file-preview {
    margin-top: 15px;
    padding: 15px;
    background: #e8f4fd;
    border-radius: 10px;
    display: none;
}

.file-preview.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

.file-preview i {
    color: #2196f3;
    margin-right: 10px;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #555;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

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

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

.submit-btn i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    display: none;
}

.loading-spinner.show {
    display: block;
}

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

/* Results Section */
.results-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f2ff;
}

.results-section h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
}

.results-section h2 i {
    margin-right: 12px;
    color: #667eea;
}

.results-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.result-card {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

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

.result-number {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.copy-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.copy-btn:hover {
    background: #218838;
    transform: scale(1.05);
}

.boleto-number {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
    word-break: break-all;
    line-height: 1.4;
}

/* API Section */
.api-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #f0f2ff;
}

.api-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
}

.api-section h2 i {
    margin-right: 12px;
    color: #667eea;
}

.api-docs {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border: 1px solid #e1e5e9;
}

.code-block {
    background: #2d3748;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-top: 15px;
    overflow-x: auto;
}

.code-block h4 {
    color: #81c784;
    margin-bottom: 10px;
    font-size: 1rem;
}

.code-block code {
    background: none;
    color: inherit;
    padding: 0;
}

.code-block pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Error Pages */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.error-content {
    text-align: center;
    padding: 40px;
}

.error-content h1 {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 20px;
}

.error-content h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 15px;
}

.error-content p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    text-decoration: none;
    color: white;
}

.btn-primary i {
    margin-right: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .main-content {
        padding: 25px;
        border-radius: 15px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .file-input-wrapper {
        padding: 30px 15px;
    }
    
    .file-input-wrapper i {
        font-size: 2.5rem;
    }
    
    .file-text {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .submit-btn {
        padding: 15px 25px;
        font-size: 1rem;
    }
    
    .boleto-number {
        font-size: 1rem;
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
    display: flex;
    align-items: center;
}

.toast i {
    margin-right: 10px;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* GitHub Fork Ribbon */
.github-fork-ribbon {
    position: fixed;
    top: 55px;
    right: -70px;
    z-index: 10000;
    display: inline-block;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-weight: 900;
    font-size: 20px;
    letter-spacing: 0.5px;
    padding: 10px 50px;
    line-height: 1;
    transform: rotate(45deg);
    transform-origin: center center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.github-fork-ribbon:hover {
    background: #24292e;
}

/* Privacy Disclaimer */
.privacy-disclaimer {
    margin-top: 15px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    line-height: 1.4;
}

.privacy-disclaimer i {
    margin-right: 10px;
    color: #4ade80;
    font-size: 1.1rem;
}

/* Responsive adjustments for GitHub ribbon */
@media (max-width: 768px) {
    .github-fork-ribbon {
        font-size: 16px;
        padding: 8px 40px;
        top: 40px;
        right: -40px;
        transform: rotate(45deg);
    }
}
