/* Professional Stock Scanner Styles */

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #059669;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --info-color: #0891b2;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f1f5f9;
    color: #334155;
}
td {
  max-width: 150px;       /* set max width */
  white-space: nowrap;    /* prevent text wrapping */
  overflow: auto;       /* hide overflowing text */
}

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

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
}

/* Form Controls */
.form-control {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.example-btn {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    text-align: left;
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    transition: all 0.3s ease;
}

.example-btn:hover {
    background-color: #f8fafc;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Table Styles */
#resultsTable {
    font-size: 0.9rem;
}

#resultsTable thead th {
    background-color: var(--dark-color) !important;
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem 0.75rem;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

#resultsTable tbody td {
    padding: 0.875rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #e2e8f0;
}

#resultsTable tbody tr:hover {
    background-color: #f8fafc;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: 6px;
    border: 1px solid #d1d5db;
    padding: 0.375rem 0.75rem;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #f8fafc !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
}

/* Loading Animation */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-info {
    background-color: #f0f9ff;
    color: #0c4a6e;
    border-left: 4px solid var(--info-color);
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

/* Stock Value Formatting */
.stock-name {
    font-weight: 600;
    color: var(--dark-color);
}

.stock-price {
    font-weight: 500;
    color: var(--success-color);
}

.stock-change-positive {
    color: var(--success-color);
}

.stock-change-negative {
    color: var(--danger-color);
}

.market-cap {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0 15px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    #resultsTable {
        font-size: 0.8rem;
    }
    
    #resultsTable thead th,
    #resultsTable tbody td {
        padding: 0.5rem 0.25rem;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

/* Utility Classes */
.text-primary-custom {
    color: var(--primary-color) !important;
}

.bg-primary-custom {
    background-color: var(--primary-color) !important;
}

.border-primary-custom {
    border-color: var(--primary-color) !important;
}

/* Table Cell Formatting */
.cell-number {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.cell-center {
    text-align: center;
}

.cell-currency::before {
    content: '₹';
    color: var(--secondary-color);
}

.cell-percentage::after {
    content: '%';
    color: var(--secondary-color);
}
