/* Custom styles for Toolbox application */

/* General styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Header styles */
header {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Tool cards */
.tool-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
    height: 100%;
    border: 1px solid #dee2e6;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: #0d6efd;
}

.tool-card .card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tool-card .card-title {
    color: #0d6efd;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.tool-card .card-text {
    flex-grow: 1;
    color: #6c757d;
    margin-bottom: 0;
}

/* Ensure linked cards maintain proper styling */
a .tool-card .card-title {
    color: #0d6efd;
}

a:hover .tool-card .card-title {
    color: #0a58ca;
}

a .tool-card .card-text {
    color: #6c757d;
}

/* Search styles */
#searchTools, #searchTable {
    border-radius: 25px;
    padding: 12px 20px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease;
}

#searchTools:focus, #searchTable:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Table styles */
.table th {
    border-top: none;
    font-weight: 600;
}

.table th a {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sort-icon {
    font-size: 0.8em;
    opacity: 0.6;
}

.table th a:hover .sort-icon {
    opacity: 1;
}

/* Form styles */
.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Button styles */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Footer styles */
footer {
    border-top: 1px solid #dee2e6;
    margin-top: auto;
}

footer a {
    color: #6c757d;
    transition: color 0.2s ease;
}

footer a:hover {
    color: #0d6efd;
}

/* Login form styles */
.card {
    border: none;
    border-radius: 12px;
}

.card.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .tool-card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .btn-sm {
        font-size: 0.8rem;
    }
}

/* Animation for loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success/Error message styles */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

/* Tool count badge */
#toolCount {
    font-size: 0.9rem;
    font-weight: 500;
}

/* No tools message */
#noToolsMessage, #noToolsTable {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
/* Chart co
ntainer styles - prevent layout shifts and crashes */
.chart-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Mortgage calculator chart fixes */
#payment-breakdown-chart,
#principal-interest-chart {
    max-width: 100% !important;
    height: auto !important;
}

/* Chart parent containers */
canvas {
    display: block;
    box-sizing: border-box;
}

/* Prevent chart overflow and layout issues */
.card-body canvas {
    max-width: 100%;
    height: auto;
}

/* Chart loading state */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #6c757d;
}

/* Chart error state */
.chart-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #dc3545;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px dashed #dee2e6;
}

/* Prevent excessive spacing around charts */
.mortgage-chart-wrapper {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Ensure proper chart responsiveness */
@media (max-width: 768px) {
    .chart-container {
        height: 250px !important;
    }
    
    #payment-breakdown-chart {
        max-height: 250px;
    }
    
    #principal-interest-chart {
        max-height: 300px;
    }
}/* T
ag-related styles */
.tag-suggestion {
    transition: all 0.2s ease;
}

.tag-suggestion:hover {
    transform: translateY(-1px);
}

.tool-card .badge {
    font-size: 0.7rem;
    font-weight: 500;
}

.tool-card:hover .badge {
    background-color: #0d6efd !important;
}

/* Tag filter styles */
.btn-outline-primary.btn-sm .badge {
    background-color: rgba(255, 255, 255, 0.8) !important;
    color: #0d6efd !important;
}

.btn-outline-primary.btn-sm:hover .badge {
    background-color: #fff !important;
    color: #0d6efd !important;
}

/* Search form improvements */
#search-form .form-control:focus,
#search-form .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Tag suggestions in add tool form */
#tag-suggestions .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

/* Responsive tag display */
@media (max-width: 768px) {
    .tool-card .badge {
        font-size: 0.65rem;
        margin-bottom: 2px;
    }
    
    #tag-suggestions .btn {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
}/* Dashboa
rd table improvements */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table th {
    white-space: nowrap;
    vertical-align: middle;
}

.table td {
    vertical-align: middle;
}

/* Dashboard tags column */
.table .badge {
    font-size: 0.7rem;
    margin-bottom: 2px;
}

/* Dashboard actions column */
.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.btn-group .btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* Edit tool form improvements */
.card.shadow {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Tool info section in edit form */
.border-top {
    border-color: #dee2e6 !important;
}

/* Responsive dashboard table */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
    
    .table .badge {
        font-size: 0.65rem;
        display: block;
        margin-bottom: 1px;
        width: fit-content;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 2px;
    }
}

/* Success/error message improvements */
.alert {
    border-radius: 8px;
    border: none;
    font-weight: 500;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

/* Form validation styles */
.form-control:invalid {
    border-color: #dc3545;
}

.form-control:valid {
    border-color: #198754;
}

/* Tag highlighting in edit form */
.tag-suggestion.btn-success {
    background-color: #198754;
    border-color: #198754;
    color: white;
}

.tag-suggestion.btn-success:hover {
    background-color: #157347;
    border-color: #146c43;
}/* Tag
 filter improvements */
.btn-outline-primary.btn-sm .badge.bg-primary {
    background-color: #0d6efd !important;
    color: white !important;
}

.btn-primary.btn-sm .badge.bg-light {
    background-color: rgba(255, 255, 255, 0.9) !important;
    color: #0d6efd !important;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Tag filter hover effects */
.btn-outline-primary.btn-sm:hover .badge {
    background-color: white !important;
    color: #0d6efd !important;
}

/* Tag filter responsive design */
@media (max-width: 768px) {
    .d-flex.flex-wrap.gap-2 {
        gap: 0.5rem !important;
    }
    
    .btn-sm {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    .btn-sm .badge {
        font-size: 0.7rem;
    }
}

/* Search form improvements */
#search-form .form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#search-form .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    transform: translateY(-1px);
}

/* Active tag filter styling */
.btn-primary.btn-sm {
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.3);
    transform: translateY(-1px);
}

/* Tag filter section styling */
.mb-4 h6.text-muted {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}