/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Force desktop layout on all devices */
html {
    min-width: 1200px;
    overflow-x: auto;
}

body {
    min-width: 1200px;
    width: auto;
    transform-origin: left top;
}

/* Mobile mode desktop - larger header elements */
@media screen and (max-width: 1199px) {
    html {
        zoom: 0.3;
        -webkit-text-size-adjust: none;
        -ms-text-size-adjust: none;
    }
    
    body {
        zoom: 1;
        width: 1200px;
        min-width: 1200px;
    }
    
    .app-container {
        width: 1200px;
        min-width: 1200px;
    }
    
    /* Larger header elements for mobile */
    .logo i {
        font-size: 3rem !important;
    }
    
    .logo h1 {
        font-size: 2.2rem !important;
        font-weight: 700 !important;
    }
    
    .btn-primary {
        font-size: 1.3rem !important;
        padding: 1.2rem 2rem !important;
        min-height: 60px !important;
    }
    
    /* Larger modal for mobile mode desktop */
    .modal-content {
        width: 600px !important;
        max-width: 95vw !important;
        transform: scale(1.4) !important;
    }
    
    .modal-header h3 {
        font-size: 1.8rem !important;
    }
    
    .modal-close {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.4rem !important;
    }
    
    .form-group label {
        font-size: 1.2rem !important;
        font-weight: 600 !important;
    }
    
    .form-group select,
    .form-group input {
        font-size: 1.1rem !important;
        padding: 1rem !important;
        min-height: 50px !important;
    }
    
    .btn {
        font-size: 1.1rem !important;
        padding: 1rem 1.5rem !important;
        min-height: 50px !important;
    }
    
    /* Fix input prefix overlap for mobile mode desktop */
    .input-prefix {
        font-size: 1.1rem !important;
        left: 1rem !important;
        font-weight: 600 !important;
        color: #4a5568 !important;
    }
    
    .input-group input {
        padding-left: 3.5rem !important;
        font-size: 1.1rem !important;
    }
    
    .form-help {
        font-size: 1rem !important;
    }
    
    /* ONLY hide header actions in mobile mode desktop, show mobile button */
    .header-actions {
        display: none !important;
    }
    
    .mobile-add-transaction {
        display: block !important;
        text-align: center !important;
        margin: 3rem auto !important;
        padding: 2rem !important;
        background: rgba(255, 255, 255, 0.1) !important;
        backdrop-filter: blur(10px) !important;
        border-radius: 1.5rem !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
        max-width: 300px !important;
    }
    
    .mobile-add-transaction .btn-primary {
        font-size: 1.4rem !important;
        padding: 1.5rem 3rem !important;
        min-height: 70px !important;
        border-radius: 1rem !important;
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
        transform: none !important;
        transition: all 0.3s ease !important;
    }
    
    .mobile-add-transaction .btn-primary:hover {
        transform: translateY(-3px) !important;
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5) !important;
    }
    
    .mobile-add-transaction .btn-primary i {
        font-size: 1.5rem !important;
        margin-right: 0.8rem !important;
    }
}

/* Ensure desktop header actions are visible on normal desktop */
@media screen and (min-width: 1200px) {
    .header-actions {
        display: flex !important;
    }
    
    .mobile-add-transaction {
        display: none !important;
    }
}

/* Prevent text selection on buttons and headings */
button,
.btn,
h1, h2, h3, h4, h5, h6,
.section-title,
.chart-title,
.card-header h3,
.section-header h3,
.dashboard-card h3,
.logo h1 {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

html, body {
    overflow-x: hidden; /* Prevent horizontal scroll */
    width: 100%;
    max-width: 100vw; /* Prevent elements from exceeding viewport width */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #2d3748;
    line-height: 1.6;
}

.app-container {
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo i {
    font-size: 2rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-family: inherit;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e53e3e;
    color: white;
    border: 1px solid #e53e3e;
}

.btn-secondary:hover {
    background: #c53030;
    border: 1px solid #c53030;
    transform: translateY(-1px);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    max-width: 1200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-header i {
    font-size: 0.875rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.balance-card .card-header i {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    color: #e17055;
}

.income-card .card-header i {
    background: linear-gradient(135deg, #55efc4, #00b894);
    color: white;
}

.expense-card .card-header i {
    background: linear-gradient(135deg, #fd79a8, #e84393);
    color: white;
}

.savings-card .card-header i {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    color: white;
}

.card-body .amount {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    
    /* Responsive font sizing based on content length */
    font-size: clamp(1.2rem, 4vw, 2rem);
}

/* Additional responsive sizing for very long amounts */
.card-body .amount.long-text {
    font-size: clamp(1rem, 3.5vw, 1.5rem);
}

.card-body .amount.very-long-text {
    font-size: clamp(0.9rem, 3vw, 1.2rem);
}

.card-body .amount.negative {
    color: #e53e3e;
}

.card-body .change {
    font-size: 0.875rem;
    color: #718096;
}

.change.positive {
    color: #38a169;
}

.change.negative {
    color: #e53e3e;
}

/* Chart Section */
.chart-section {
    margin-top: 4rem;
    margin-bottom: 2rem;
    max-width: 1200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    clear: both;
}

.chart-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
}

.chart-controls select {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    background: white;
    font-size: 0.875rem;
    cursor: pointer;
}

.chart-content {
    height: 300px;
    position: relative;
}

/* Data Section */
.data-section {
    margin-bottom: 2rem;
    max-width: 1200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.transactions-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Categories and Savings Section */
.categories-savings-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    align-items: stretch;
    gap: 2rem;
    margin-bottom: 6rem;
    max-width: 1200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    max-height: 320px;
}

.transactions-container,
.categories-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.categories-savings-section .card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.categories-savings-section .card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.savings-card .card-body {
    height: 100%;
}

.savings-card .amount {
    margin-bottom: 0.5rem;
}

.savings-card .change {
    margin-bottom: 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
}

.section-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    background: white;
    font-size: 0.875rem;
    min-width: 200px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.section-controls select {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    background: white;
    font-size: 0.875rem;
    cursor: pointer;
}

/* Transaction List */
.transactions-scroll-wrapper {
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 400px;
}

.transactions-list {
    min-width: 100%;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
    min-width: 100%;
    white-space: nowrap;
}

.transaction-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1rem;
}

.transaction-icon.income {
    background: linear-gradient(135deg, #55efc4, #00b894);
    color: white;
}

.transaction-icon.expense {
    background: linear-gradient(135deg, #fd79a8, #e84393);
    color: white;
}

.transaction-icon.savings {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    color: white;
}

.transaction-details {
    flex: 1;
}

.transaction-details h4 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.transaction-details p {
    font-size: 0.75rem;
    color: #718096;
    margin: 0;
}

.transaction-category,
.transaction-date {
    display: inline;
}

.transaction-category::after {
    content: " • ";
    color: #a0aec0;
}

.transaction-amount {
    font-size: 1rem;
    font-weight: 600;
}

.transaction-amount.income {
    color: #38a169;
}

.transaction-amount.expense {
    color: #e53e3e;
}

.transaction-amount.savings {
    color: #3182ce;
}

.transaction-amount.withdraw {
    color: #d69e2e;
}

/* Delete button styling */
.btn-delete {
    background: none !important;
    border: none !important;
    color: #e53e3e !important;
    cursor: pointer !important;
    padding: 0.5rem !important;
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 0.5rem !important;
    transition: background-color 0.2s ease !important;
    flex-shrink: 0 !important;
}

.btn-delete:hover {
    background: rgba(229, 62, 62, 0.1) !important;
}

.btn-delete i {
    font-size: 0.875rem !important;
}

/* Mobile Chart Button - Hidden on desktop */
.mobile-chart-button {
    display: none;
}

/* Mobile Add Transaction Button Container */
.mobile-add-transaction {
    display: none; /* Hidden by default, shown only in mobile mode desktop */
    text-align: center;
    margin: 2rem 0;
    padding: 1rem;
}

/* Transaction icon styling */
.transaction-icon.withdraw {
    background: rgba(214, 158, 46, 0.1);
    color: #d69e2e;
}

/* Categories Chart */
.categories-chart {
    height: 120px;
    margin-bottom: 1rem;
}

/* Savings Chart */
.savings-chart {
    flex: 1;
    margin-top: 1rem;
    min-height: 150px;
    position: relative;
    padding-right: 1rem;
}

.savings-chart canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
}

/* Savings Progress Bar Styles */
.savings-progress {
    margin-top: 1rem;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.progress-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.progress-label.income {
    color: #38a169;
}

.progress-label.expense {
    color: #e53e3e;
}

.progress-label::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.progress-label.income::before {
    background-color: #38a169;
}

.progress-label.expense::before {
    background-color: #e53e3e;
}

.progress-bar-container {
    background: #f7fafc;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.progress-bar {
    display: flex;
    height: 100%;
    width: 100%;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.progress-fill.income {
    background: linear-gradient(90deg, #38a169, #48bb78);
}

.progress-fill.expense {
    background: linear-gradient(90deg, #e53e3e, #fc8181);
}

.categories-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    max-height: 120px;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.category-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 1rem;
}

.category-details {
    flex: 1;
}

.category-details h5 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.category-details p {
    font-size: 0.75rem;
    color: #718096;
}

.category-amount {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e53e3e;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    width: 420px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #718096;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Form Styles */
.transaction-form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Special styling for numeric input fields */
#transactionAmount,
#savingsAmount,
#withdrawAmount {
    background-color: #fff2c2;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 0.75rem;
    font-size: 0.875rem;
    color: #718096;
    z-index: 1;
}

.input-group input {
    padding-left: 2.5rem;
}

.form-help {
    font-size: 0.75rem;
    color: #718096;
    margin-top: 0.25rem;
    display: block;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Chart Modal */
.chart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    padding: 0;
}

.chart-modal-content {
    background: white;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

.chart-modal-header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    flex-shrink: 0;
    min-width: 180px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.chart-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    writing-mode: horizontal-tb;
    text-orientation: upright;
    transform: rotate(-90deg);
    white-space: nowrap;
}

.chart-modal-header .modal-close {
    writing-mode: horizontal-tb;
    margin-top: auto;
}

.chart-modal-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.chart-modal-controls select {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: #374151;
    min-width: 120px;
}

.chart-modal-body {
    flex: 1;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    overflow: hidden;
    position: relative;
}

.chart-modal-body canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.chart-modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVE CSS DISABLED - All media queries changed to never activate */
@media (max-width: 0px) {
    .dashboard-cards {
        max-width: 100%;
        grid-template-columns: 1fr 1fr;
        padding: 0 1rem;
    }
    
    .dashboard-cards .card:nth-child(3) {
        grid-column: 1 / 3;
    }
    
    .data-section,
    .categories-savings-section,
    .chart-section {
        max-width: 100%;
        padding: 0 1rem;
    }
}

@media (max-width: 0px) {
    .main-content {
        padding: 1rem;
    }
    
    /* All containers stacked vertically */
    .dashboard-cards {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        max-width: none;
    }
    
    .dashboard-card {
        width: 100%;
    }
    
    .data-section {
        margin-bottom: 1rem;
    }
    
    .categories-savings-section {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 3rem;
        max-height: none;
    }
    
    .categories-savings-section .card {
        height: auto;
        min-height: 300px;
        width: 100%;
    }
    
    .savings-chart {
        min-height: 200px;
    }
    
    .categories-chart {
        height: 180px;
    }
    
    /* Hide chart section on mobile */
    .chart-section {
        display: none;
    }
    
    /* Show mobile chart button */
    .mobile-chart-button {
        display: block;
        text-align: center;
        margin: 2rem 0;
    }
    
    .btn-chart {
        background: linear-gradient(135deg, #667eea, #764ba2);
        color: white;
        border: none;
        padding: 1rem 2rem;
        border-radius: 1rem;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
    
    .btn-chart:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }
    
    .btn-chart i {
        font-size: 1.1rem;
    }

    /* Header mobile adjustments */
    .header-content {
        padding: 0 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    /* Change button text to "Tambah" on mobile */
    #addTransactionBtn .btn-text {
        display: none;
    }
    
    #addTransactionBtn::after {
        content: "Tambah";
        margin-left: 0.5rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .chart-container,
    .transactions-container,
    .categories-container {
        padding: 1rem;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    /* Transaction section controls horizontal */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .section-controls {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        width: 100%;
        align-items: center;
    }
    
    .search-input {
        flex: 1;
        min-width: 0;
    }
    
    .category-filter {
        flex-shrink: 0;
        min-width: 120px;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95vw;
        margin: 0;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* Financial chart legend mobile styling */
    .chart-container canvas {
        margin-bottom: 1rem;
    }
    
    /* Custom legend styling for mobile */
    .chart-container .chartjs-legend {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .chart-container .chartjs-legend ul {
        display: flex !important;
        flex-direction: row !important;
        gap: 1rem !important;
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .chart-container .chartjs-legend li {
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        font-size: 12px !important;
    }
    
    .chart-container .chartjs-legend li span {
        display: inline-block !important;
        width: 8px !important;
        height: 8px !important;
        border-radius: 50% !important;
    }
}

@media (max-width: 0px) {
    .main-content {
        padding: 0.75rem;
    }
    
    /* Ensure all containers stack vertically */
    .dashboard-cards {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .dashboard-card {
        padding: 1rem;
        min-height: 120px;
        width: 100%;
    }
    
    .dashboard-card h3 {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }
    
    .dashboard-card p {
        font-size: 1.25rem;
        font-weight: 600;
    }
    
    .header-content {
        padding: 0 0.75rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .logo h1 {
        font-size: 1.1rem;
    }
    
    /* Button text change for mobile */
    #addTransactionBtn .btn-text {
        display: none;
    }
    
    #addTransactionBtn::after {
        content: "Tambah";
        margin-left: 0.5rem;
    }
    
    .card {
        padding: 0.75rem;
    }
    
    .chart-container,
    .transactions-container,
    .categories-container {
        padding: 0.75rem;
    }
    
    .chart-title {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .modal-content {
        width: 98%;
        max-width: 98vw;
        margin: 0;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input,
    .form-group select {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    /* Stack categories and savings vertically */
    .categories-savings-section {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .categories-savings-section .card {
        min-height: 250px;
        width: 100%;
    }
    
    .savings-chart {
        min-height: 180px;
    }
    
    .categories-chart {
        height: 160px;
    }
    
    .transaction-item {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .transaction-amount {
        font-size: 0.95rem;
    }
    
    .transaction-icon {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
    
    .data-section {
        margin-bottom: 0.75rem;
    }
    
    .categories-savings-section {
        margin-bottom: 2rem;
    }
    
    .card-body .amount {
        font-size: 1.5rem;
    }
    
    /* Search and category filter horizontal on mobile */
    .section-controls {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        width: 100%;
        align-items: center;
    }
    
    .search-input {
        flex: 1;
        min-width: 0;
    }
    
    .category-filter {
        flex-shrink: 0;
        min-width: 100px;
        font-size: 0.85rem;
    }
}

/* Extra small devices */
@media (max-width: 0px) {
    .main-content {
        padding: 0.5rem;
    }
    
    .dashboard-card {
        padding: 0.75rem;
        min-height: 100px;
    }
    
    .dashboard-card h3 {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }
    
    .dashboard-card p {
        font-size: 1.1rem;
    }
    
    .card {
        padding: 0.5rem;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95vw;
        margin: 0;
    }
    
    .categories-savings-section .card {
        min-height: 200px;
    }
    
    .savings-chart {
        min-height: 150px;
    }
    
    .categories-chart {
        height: 140px;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    /* Mobile horizontal scrolling for transactions */
    .transactions-scroll-wrapper {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #667eea transparent;
        padding-bottom: 0.5rem;
    }
    
    .transactions-scroll-wrapper::-webkit-scrollbar {
        height: 6px;
    }
    
    .transactions-scroll-wrapper::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 3px;
    }
    
    .transactions-scroll-wrapper::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, #667eea, #764ba2);
        border-radius: 3px;
    }
    
    .transactions-list {
        min-width: max-content;
        width: auto;
    }
    
    .transaction-item {
        min-width: 450px;
        white-space: nowrap;
        flex-shrink: 0;
        padding: 0.75rem;
    }
    
    .transaction-details {
        overflow: hidden;
        max-width: 180px;
        white-space: normal;
    }
    
    .transaction-details h4 {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .transaction-category,
    .transaction-date {
        display: block;
        font-size: 0.7rem;
        line-height: 1.2;
    }
    
    .transaction-category::after {
        content: "";
    }
    
    .transaction-amount {
        min-width: 90px;
        text-align: right;
        font-size: 0.9rem;
    }
    
    .transaction-icon {
        width: 32px;
        height: 32px;
        margin-right: 0.75rem;
        font-size: 0.85rem;
    }
    
    .btn-delete {
        padding: 0.4rem !important;
        font-size: 0.8rem;
        margin-left: 0.5rem !important;
        width: 32px !important;
        height: 32px !important;
        flex-shrink: 0 !important;
    }
}

/* Chart responsiveness improvements - DISABLED */
@media (max-width: 0px) {
    .chart-container canvas {
        max-height: 300px !important;
    }
    
    .savings-chart canvas {
        max-height: 200px !important;
    }
    
    .categories-chart canvas {
        max-height: 180px !important;
    }
}

@media (max-width: 0px) {
    .chart-container canvas {
        max-height: 250px !important;
    }
    
    .savings-chart canvas {
        max-height: 180px !important;
    }
    
    .categories-chart canvas {
        max-height: 160px !important;
    }
}

@media (max-width: 0px) {
    .chart-container canvas {
        max-height: 200px !important;
    }
    
    .savings-chart canvas {
        max-height: 150px !important;
    }
    
    .categories-chart canvas {
        max-height: 140px !important;
    }
}

/* Prevent text selection on all screen sizes */
.dashboard-cards,
.data-section,
.categories-savings-section,
.card,
.transaction-item {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Additional user-select prevention for UI elements */
.card-header,
.card-body .amount,
.dashboard-card,
.transaction-icon,
.chart-controls,
.chart-header,
.section-controls,
.logo,
.header-actions,
.modal-header,
select,
option {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Allow text selection only for input fields and content areas */
input[type="text"],
input[type="number"],
input[type="date"],
textarea,
.transaction-details,
.categories-list {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* Ensure text doesn't cause overflow */
.transaction-item .transaction-details h4,
.transaction-item .transaction-details p,
.transaction-amount {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}
