/**
 * Master Investment Page Styles
 * Generic styles for all investment apartment tables and price history features
 */

/* Loading Spinner Styles */
.loading-spinner {
    padding: 20px;
    text-align: center;
    color: #666;
}

.loading-spinner i {
    margin-right: 8px;
    font-size: 16px;
}

/* Apartment Table Enhancements */
#table_id {
    border-collapse: collapse;
    width: 100%;
}

#table_id thead th {
    background-color: #383e42;
    color: white;
    font-weight: bold;
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #333;
}

#table_id tbody td {
    padding: 15px 10px;
    border: 1px solid #ddd;
    vertical-align: middle;
}

/* Status Styling */
#avail strong {
    color: #28a745;
    /* background-color: #d4edda; */
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

#hold strong {
    color: #ff8f00;
    /* background-color: #fff3cd; */
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

#sold strong {
    color: #dc3545;
    /* background-color: #f8d7da; */
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Price History Button */
.price-history-btn {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.price-history-btn:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    transform: translateY(-1px);
}

.price-history-btn i {
    margin-right: 4px;
}

/* Modal Enhancements */
.modal-dialog.modal-lg {
    max-width: 900px;
}

.modal-header {
    background-color: #383e42;
    color: white;
    border-bottom: none;
}

.modal-header .close {
    color: white;
    opacity: 0.8;
}

.modal-header .close:hover {
    opacity: 1;
}

.modal-title {
    font-weight: bold;
    font-size: 1.1rem;
}

/* Apartment Info in Modal */
.apartment-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.apartment-info h5 {
    margin-bottom: 10px;
    color: #383e42;
    font-weight: bold;
}

.apartment-info p {
    margin-bottom: 5px;
}

/* Price History Table */
.table-responsive {
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,.02);
}

.table th {
    background-color: #383e42;
    color: white;
    font-weight: 600;
    border: none;
    padding: 12px;
    font-size: 13px;
}

.table td {
    padding: 10px 12px;
    border: none;
    font-size: 13px;
}

/* Price Change Indicators */
.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-info {
    color: #000000 !important;
    /* color: #17a2b8 !important; */
}

.text-muted {
    color: #6c757d !important;
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 5px;
    padding: 12px 15px;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert i {
    margin-right: 8px;
}

/* Disclaimer Text */
.disclaimer-text {
    margin-top: 15px;
    font-style: italic;
    color: #6c757d;
    font-size: 14px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-dialog.modal-lg {
        max-width: 95%;
        margin: 10px auto;
    }
    
    .apartment-info .row .col-md-6 {
        margin-bottom: 10px;
    }
    
    .price-history-btn {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .price-history-btn span {
        display: none; /* Hide text on mobile, keep icon */
    }
    
    .table-responsive {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 8px 4px;
    }
}

/* DataTable Loading State */
.dataTables_processing {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #666;
    font-size: 14px;
    padding: 20px;
}

/* Error State */
.table-error {
    color: #dc3545;
    text-align: center;
    padding: 30px;
}

.table-error i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

/* Accessibility Improvements */
.price-history-btn:focus,
.modal .close:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .price-history-btn,
    .modal,
    .loading-spinner {
        display: none !important;
    }
    
    #table_id {
        font-size: 12px;
    }
    
    #table_id th,
    #table_id td {
        padding: 6px 4px;
    }
}

/* Styles for DataTables expandable rows */
td.details-control {
    text-align: center;
    cursor: pointer;
    width: 30px;
}
td.details-control:before {
    content: '+';
    font-weight: bold;
    font-size: 1.5em;
    color: #28a745; /* Green */
    display: inline-block;
    transition: transform 0.2s ease-in-out;
}
tr.shown td.details-control:before {
    content: '-';
    font-weight: bold;
    font-size: 1.5em;
    color: #dc3545; /* Red */
    transform: rotate(180deg);
}

/* Style for other clickable cells */
td.row-clickable {
    cursor: pointer;
}

.list-group-flush {
    border-radius: 5px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
}

.list-group-item {
    background-color: #fdfdfd;
    border-color: #f0f0f0;
}

.badge-primary {
    background-color: #383e42;
}
.prospekt-button {
	margin-top: 12px;
    height: 50px;
    float: left;
    color: #ffffff;
	padding: 0 12px 0 12px;
	background: #999;
    text-align: center;
    line-height: 47px;
    font-size: 16px;
    -webkit-transition: all 0.5s;
    -o-transition: all 0.5s;
    -ms-transition: all 0.5s;
    -moz-transition: all 0.5s;
    transition: all 0.5s;
    border: 2px solid #999;
    border-radius: 4px !important;
}
.prospekt-button:hover{
	background: #000;
    border: 2px solid #000;
    -webkit-transition: all 0.5s;
    -o-transition: all 0.5s;
    -ms-transition: all 0.5s;
    -moz-transition: all 0.5s;
    transition: all 0.5s;
    color: #fff;
}

/* DataTables Responsive Mobile Fixes */
@media (max-width: 767px) {
    /* Fix narrow column widths on mobile */
    table.dataTable thead th,
    table.dataTable thead td {
        padding: 8px 4px !important;
        font-size: 12px !important;
        min-width: 50px !important;
    }
    
    /* Increase spacing between column names and sorting arrows */
    table.dataTable thead .sorting,
    table.dataTable thead .sorting_asc,
    table.dataTable thead .sorting_desc {
        padding-right: 20px !important;
        background-position: center right 4px !important;
    }
    
    /* Fix table cell padding on mobile */
    table.dataTable tbody td {
        /* padding: 8px 4px !important; */
        font-size: 14px !important;
        word-wrap: break-word !important;
    }
    
    /* Ensure table doesn't overflow on mobile */
    .table-responsive {
        overflow-x: visible !important;
    }
    
    /* Fix responsive control button spacing */
    table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
    table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
        padding-left: 15px !important;
    }
    
    /* Better mobile table width */
    #table_id {
        width: 100% !important;
        table-layout: fixed !important;
    }
}