/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-img {
    max-height: 60px;
    max-width: 200px;
    height: auto;
    width: auto;
    filter: brightness(0) invert(1); /* Torna a logo branca */
}

.logo i {
    font-size: 2.5rem;
    color: #ffd700;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Loading Section */
.loading-section {
    text-align: center;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-section p {
    color: #666;
    font-size: 1.1rem;
}

/* Result Section */
.result-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.status-badge.pago {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.aberto {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-badge i {
    font-size: 0.8rem;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #667eea;
}

.info-header i {
    font-size: 1.2rem;
}

.info-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.info-content p {
    margin-bottom: 8px;
    color: #555;
}

.info-content strong {
    color: #333;
}

/* QR Code Section */
.qrcode-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    border: 1px solid #e9ecef;
}

.qrcode-container h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.qrcode {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.copy-section p {
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.copy-box {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.copy-textarea {
    flex: 1;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    background: white;
}

.copy-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.copy-button {
    padding: 12px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.copy-button:hover {
    background: #218838;
    transform: translateY(-2px);
}

.copy-button:active {
    transform: translateY(0);
}

/* Error Section */
.error-section {
    text-align: center;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.error-content i {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 20px;
}

.error-content h3 {
    color: #dc3545;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.error-content p {
    color: #666;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.retry-button {
    padding: 12px 25px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.retry-button:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

.footer i {
    color: #ff6b6b;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
        min-height: 100vh;
    }
    
    .header {
        padding: 1.5rem 0;
        margin-bottom: 20px;
    }
    
    .header-content {
        padding: 0 1rem;
    }
    
    .logo-img {
        max-height: 50px;
        max-width: 150px;
    }
    
    .main-content {
        gap: 20px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .info-card {
        padding: 20px;
        margin-bottom: 0;
    }
    
    .info-header {
        margin-bottom: 15px;
    }
    
    .info-header h3 {
        font-size: 1.1rem;
    }
    
    .info-content p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .copy-box {
        flex-direction: column;
        gap: 15px;
    }
    
    .copy-textarea {
        min-height: 80px;
        font-size: 0.9rem;
    }
    
    .copy-button {
        align-self: stretch;
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .qrcode {
        max-width: 180px;
        max-height: 180px;
    }
    
    .status-badge {
        font-size: 0.9rem;
        padding: 8px 16px;
    }
    
    .loading-section,
    .error-section {
        padding: 30px 20px;
    }
    
    .spinner {
        width: 40px;
        height: 40px;
    }
    
    .retry-button {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
    
    .footer {
        padding: 1.5rem 0;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .header {
        padding: 1rem 0;
        margin-bottom: 15px;
    }
    
    .header-content {
        padding: 0 0.5rem;
    }
    
    .logo-img {
        max-height: 45px;
        max-width: 120px;
    }
    
    .main-content {
        gap: 15px;
    }
    
    .info-card {
        padding: 15px;
        border-radius: 12px;
    }
    
    .info-header h3 {
        font-size: 1rem;
    }
    
    .info-content p {
        font-size: 0.9rem;
    }
    
    .copy-textarea {
        min-height: 70px;
        font-size: 0.85rem;
        padding: 10px;
    }
    
    .copy-button {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .qrcode {
        max-width: 160px;
        max-height: 160px;
    }
    
    .qrcode-section {
        padding: 20px 15px;
    }
    
    .qrcode-container h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .status-badge {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    
    .loading-section,
    .error-section {
        padding: 25px 15px;
        border-radius: 12px;
    }
    
    .spinner {
        width: 35px;
        height: 35px;
    }
    
    .loading-section p {
        font-size: 0.95rem;
    }
    
    .error-content h3 {
        font-size: 1.1rem;
    }
    
    .error-content p {
        font-size: 0.9rem;
    }
    
    .retry-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .footer {
        padding: 1rem 0;
        font-size: 0.85rem;
    }
}

/* Otimizações específicas para telas muito pequenas */
@media (max-width: 360px) {
    .container {
        padding: 0 0.25rem;
    }
    
    .header-content {
        padding: 0 0.25rem;
    }
    
    .logo-img {
        max-height: 40px;
        max-width: 100px;
    }
    
    .info-card {
        padding: 12px;
    }
    
    .info-header h3 {
        font-size: 0.95rem;
    }
    
    .info-content p {
        font-size: 0.85rem;
    }
    
    .copy-textarea {
        min-height: 60px;
        font-size: 0.8rem;
    }
    
    .copy-button {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .qrcode {
        max-width: 140px;
        max-height: 140px;
    }
    
    .status-badge {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
}

/* Orientação landscape em dispositivos móveis */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        padding: 1rem 0;
        margin-bottom: 15px;
    }
    
    .logo-img {
        max-height: 40px;
        max-width: 120px;
    }
    
    .main-content {
        gap: 15px;
    }
    
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .info-card {
        padding: 15px;
    }
    
    .qrcode {
        max-width: 120px;
        max-height: 120px;
    }
}

/* Melhorias para touch em dispositivos móveis */
@media (hover: none) and (pointer: coarse) {
    .copy-button,
    .retry-button {
        min-height: 44px; /* Tamanho mínimo recomendado para touch */
    }
    
    .copy-textarea {
        font-size: 16px; /* Evita zoom automático no iOS */
    }
    
    .info-card:hover {
        transform: none; /* Remove hover em dispositivos touch */
    }
    
    .copy-button:hover,
    .retry-button:hover {
        transform: none; /* Remove hover em dispositivos touch */
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

.result-section,
.loading-section,
.error-section {
    animation: fadeIn 0.5s ease-out;
}

/* Melhorias de acessibilidade */
.copy-button:focus,
.retry-button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Estados de hover melhorados */
.info-card:hover {
    border-color: #667eea;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}