/* Custom Styles for Investment Portfolio Manager */
/* Brand Identity is imported via brand.css */

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

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.nav-link {
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

/* Page Content */
.page-content {
    min-height: calc(100vh - 56px);
    background-color: #f8f9fa;
}

/* Summary Cards */
.summary-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    cursor: pointer;
    z-index: 1;
}

.summary-card:hover {
    z-index: 1001;
}

/* Ensure parent containers don't clip tooltips */
.row > [class*="col-"] {
    overflow: visible;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.summary-card:hover::before {
    opacity: 1;
}

.summary-card-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.summary-card-primary .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.summary-card-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.summary-card-success .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.summary-card-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.summary-card-info .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.summary-card-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.summary-card-warning .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.summary-card-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.summary-card-danger .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.summary-card .card-body {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.summary-card h2, .summary-card h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.summary-card-sm h3,
.summary-card-sm h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0;
}

.summary-card-sm .card-body {
    padding: 0.5rem 0.75rem;
}

.summary-card-sm h6 {
    font-size: 0.65rem;
    margin-bottom: 0.4rem;
}

.summary-card-sm small {
    font-size: 0.7rem;
}

.summary-icon-sm {
    font-size: 1.75rem !important;
    opacity: 0.2;
}

.summary-card h6 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.summary-icon {
    font-size: 3rem;
    opacity: 0.3;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Breakdown Tooltip */
.breakdown-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    min-width: 250px;
    max-width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 1002;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    white-space: normal;
}

.breakdown-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.95);
}

.summary-card:hover .breakdown-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(5px);
}

.breakdown-header {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: #d4af37;
}

.breakdown-content {
    font-size: 0.875rem;
    max-height: 300px;
    overflow-y: auto;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-item-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 0.5rem;
}

.breakdown-item-value {
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

/* Property Cards */
.property-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    overflow: hidden;
}

.property-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.property-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1.25rem;
    border-radius: 15px 15px 0 0 !important;
    position: relative;
    overflow: visible;
}

.property-value-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #d4af37;
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    text-align: right;
}

.property-mortgage-badge {
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

.property-equity-badge {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: white;
}

.property-info-value.text-gold {
    color: #d4af37;
    font-weight: 700;
}

.property-card .card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
}

.property-card .status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-OWNED {
    background-color: #d4edda;
    color: #155724;
}

.status-INTEREST {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-SOLD {
    background-color: #e2e3e5;
    color: #383d41;
}

.property-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.property-info:last-child {
    border-bottom: none;
}

.property-info-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.875rem;
}

.property-info-value {
    font-weight: 600;
    color: #212529;
}

/* Map Styles */
#map {
    border-radius: 15px;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.custom-marker {
    background: transparent !important;
    border: none !important;
}

.legend-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Cluster Marker Styles */
.custom-cluster {
    background: transparent !important;
    border: none !important;
}

.cluster-marker-container {
    transition: all 0.3s ease;
}

.cluster-marker-container:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.8) !important;
}

.cluster-marker-container:hover .cluster-breakdown-tooltip {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure cluster tooltips are above everything */
.leaflet-marker-icon.custom-cluster {
    z-index: 1000 !important;
}

.cluster-breakdown-tooltip {
    z-index: 10000 !important;
}

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

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px 10px 0 0;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* Form Styles */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Button Styles */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.5rem 1.25rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Filter Buttons */
.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

.btn-group .btn:last-child {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}

.btn-group .btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .summary-card h3 {
        font-size: 1.5rem;
    }
    
    .property-card {
        margin-bottom: 1rem;
    }
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Currency Display */
.currency-symbol {
    font-weight: 600;
}

/* Property Actions */
.property-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.property-actions .btn {
    flex: 1;
    font-size: 0.875rem;
}

/* Card Enhancements */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    border-radius: 15px 15px 0 0 !important;
    font-weight: 600;
}

/* Table Enhancements */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
}

/* Progress Bar Enhancements */
.progress {
    border-radius: 10px;
    overflow: hidden;
    background-color: #e9ecef;
}

.progress-bar {
    transition: width 0.6s ease;
}

.bg-gold {
    background-color: #d4af37 !important;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

