/* Base Styles */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* Prevent text size adjustment on mobile */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Better touch feedback */
a, button, input, textarea, select {
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-tap-highlight-color: transparent;
}

/* Prevent iOS zoom on input focus */
@supports (-webkit-overflow-scrolling: touch) {
    input, textarea, select {
        font-size: 16px !important;
    }
}

.card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.card-header {
    padding: 1.5rem;
    border-bottom: none;
}

.card-body {
    padding: 2rem;
}

.form-select, .form-control {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.form-select:focus, .form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.btn-primary {
    background-color: #0d6efd;
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    transform: translateY(-2px);
}

#result {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.result-content {
    font-size: 1.1rem;
    line-height: 1.6;
    min-height: 100px;
    white-space: pre-wrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card {
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-header h2 {
        font-size: 1.4rem;
        margin-bottom: 0.25rem;
    }
    
    .card-header p {
        font-size: 0.9rem;
    }
    
    .form-control, .form-select {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
    
    .btn {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .result-content {
        font-size: 1rem;
        padding: 1rem !important;
    }
}

/* Extra small devices */
@media (max-width: 400px) {
    .card-header h2 {
        font-size: 1.25rem;
    }
    
    .btn {
        padding: 0.6rem;
        font-size: 0.95rem;
    }
}

/* Orientation changes */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .container {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .card {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* PWA specific styles */
@media all and (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .container {
        padding-top: 1rem;
    }
}

/* Animation for the result */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

#result {
    animation: fadeIn 0.5s ease-out;
    will-change: transform, opacity;
}

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

.spinner-border {
    animation: spin 0.75s linear infinite;
    width: 2.5rem;
    height: 2.5rem;
    border-width: 0.25em;
}

/* Button hover effects */
.btn {
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: translateY(2px);
}

.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Form elements */
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Accessibility */
.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;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Navigation */
.navbar {
    padding: 0.8rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: #fff !important;
    transform: translateY(-2px);
}

/* Contact Section */
#contact {
    background-color: #f8f9fa;
    position: relative;
    overflow: hidden;
    padding: 4rem 0;
}

#contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(13, 110, 253, 0.1) 100%);
    z-index: 0;
}

#contact .container {
    position: relative;
    z-index: 1;
}

/* Footer */
footer {
    background-color: #212529;
    color: #fff;
    padding: 2rem 0;
}

footer a {
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}

footer a:hover {
    color: #0d6efd;
    text-decoration: underline;
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 10px;
    overflow: hidden;
}

.modal-header {
    background-color: #0d6efd;
    color: white;
    border-bottom: none;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 2rem;
}

.modal-body h6 {
    color: #0d6efd;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.modal-body ul {
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #0d6efd;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #0b5ed7;
    color: white;
    transform: translateY(-3px);
}

/* Loading spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Copy button feedback */
.copied {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: white !important;
}
