/* Custom Styles for Proaco POC */

:root {
    --primary-blue: #3B82F6;
    --success-green: #10B981;
    --danger-red: #EF4444;
    --warning-orange: #F97316;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* View Transitions */
.view {
    display: none !important;
    animation: fadeIn 0.3s ease-in-out;
}

.view.active {
    display: block !important;
}

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

/* Material Icons */
.material-symbols-outlined {
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
    user-select: none;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background-color: #2563EB;
}

.btn-secondary {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background-color: var(--gray-200);
}

.btn-danger {
    background-color: var(--danger-red);
    color: white;
}

.btn-danger:hover {
    background-color: #DC2626;
}

.btn-success {
    background-color: var(--success-green);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

/* Transaction Icon Circles */
.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.transaction-icon.payment {
    background-color: #D1FAE5;
    color: var(--success-green);
}

.transaction-icon.installment {
    background-color: #F3F4F6;
    color: var(--gray-600);
}

.transaction-icon.adjustment {
    background-color: #FED7AA;
    color: var(--warning-orange);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Date Picker Custom Styles */
.date-picker-wrapper {
    position: relative;
}

.date-picker-input {
    cursor: pointer;
}

/* Slider Styles */
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #E5E7EB;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-blue);
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-blue);
    cursor: pointer;
    border: none;
}

/* Tab Navigation */
.tab {
    position: relative;
    padding-bottom: 8px;
    cursor: pointer;
    transition: color 0.2s;
}

.tab.active {
    color: var(--primary-blue);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-blue);
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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

/* Desktop: Fixed width and centered */
@media (min-width: 768px) {
    body {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding: 20px;
        background-color: #E5E7EB;
    }
    
    #app {
        width: 100%;
        max-width: 428px;
        margin: 0 auto;
        background-color: #F9FAFB;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        border-radius: 12px;
        overflow: hidden;
        min-height: calc(100vh - 40px);
        max-height: calc(100vh - 40px);
    }
    
    .view {
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .modal-content {
        padding: 20px;
        max-width: 95%;
    }
}

/* Ensure logo doesn't break layout */
header img {
    max-height: 32px;
    object-fit: contain;
}

/* Fix for date picker positioning on mobile */
@media (max-width: 640px) {
    .date-picker-calendar {
        left: 0 !important;
        right: 0 !important;
        margin: 0 auto;
        width: calc(100% - 2rem) !important;
        max-width: 400px;
    }
}

/* Improve touch targets on mobile */
@media (max-width: 640px) {
    button, .btn {
        min-height: 44px;
    }
    
    .card {
        min-height: 44px;
    }
}

