/* Custom styles for PDF Converter */

/* Drag and drop upload area */
#upload-area {
    transition: all 0.3s ease;
    cursor: pointer;
}

#upload-area:hover {
    border-color: var(--bs-primary) !important;
    background-color: var(--bs-secondary);
}

#upload-area.drag-over {
    border-color: var(--bs-success) !important;
    background-color: var(--bs-success-bg);
    transform: scale(1.02);
}

#upload-area.drag-error {
    border-color: var(--bs-danger) !important;
    background-color: var(--bs-danger-bg);
}

/* File input styling */
#file-input {
    display: none;
}

/* Progress animations */
.spinner-border {
    animation: spinner-border 0.75s linear infinite;
}

/* Custom button styles */
.btn-file {
    position: relative;
    overflow: hidden;
}

.btn-file input[type=file] {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 100%;
    min-height: 100%;
    font-size: 100px;
    text-align: right;
    filter: alpha(opacity=0);
    opacity: 0;
    outline: none;
    background: white;
    cursor: inherit;
    display: block;
}

/* Card hover effects */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Badge styling */
.badge {
    font-size: 0.8em;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
    
    #upload-area {
        padding: 2rem 1rem !important;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.5rem;
    }
    
    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Success/Error messages */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* File type icons */
.file-icon {
    font-size: 1.2em;
    margin-right: 0.5rem;
}

/* Conversion type toggle */
.btn-check:checked + .btn {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

/* Footer styling */
footer {
    margin-top: auto;
}

/* Form validation styling */
.was-validated .form-control:valid {
    border-color: var(--bs-success);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='m2.3 6.73.94-.94 1.38 1.38-2.32 2.32-1.38-1.38z'/%3e%3c/svg%3e");
}

.was-validated .form-control:invalid {
    border-color: var(--bs-danger);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 1.4 1.4 1.4-1.4'/%3e%3c/svg%3e");
}

/* Dark theme improvements */
[data-bs-theme="dark"] .card {
    border: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: var(--bs-dark);
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Focus states for keyboard navigation */
.btn:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Google AdSense Ad Styling */
.ad-container, .sidebar-ad-container, .footer-ad-container {
    max-width: 100%;
    margin: 0 auto;
    border: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
}

.adsense-unit, .adsense-sidebar, .adsense-footer {
    min-height: 50px;
    background: #ffffff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive ad containers */
@media (max-width: 768px) {
    .sidebar-ad-container {
        margin-bottom: 20px;
    }
    
    .footer-ad-container {
        padding: 15px 10px;
    }
}

/* Business users - no ads */
.ad-free-badge {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8em;
    display: inline-block;
}

/* Print styles */
@media print {
    .navbar,
    footer,
    .btn,
    #upload-area,
    .ad-container {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}
