/* =============================================
   STYLE UTAMA APLIKASI ANALISIS SAHAM SYARIAH
   ============================================= */

/* Reset dan Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.db-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.db-status.connected {
    background: #28a745;
    color: white;
}

.db-status.disconnected {
    background: #dc3545;
    color: white;
}

/* Database Controls */
.database-controls {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.db-status-message {
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 5px;
}

.nav-links {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

/* Control Styles */
.controls {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
}

.control-group {
    flex: 1;
    min-width: 200px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.control-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.control-group select:focus {
    outline: none;
    border-color: #667eea;
}

.control-actions {
    display: flex;
    gap: 10px;
}

/* Button Styles */
.btn-primary, .btn-secondary, .btn-warning, .btn-small {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #555;
    border: 2px solid #e1e5e9;
}

.btn-secondary:hover:not(:disabled) {
    background: #e9ecef;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #ff8c00);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading Styles */
.loading {
    text-align: center;
    padding: 50px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress {
    width: 100%;
    background: #e1e5e9;
    border-radius: 10px;
    margin-top: 20px;
    height: 10px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s;
}

/* Results Styles */
.results {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

.results-header {
    padding: 25px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.results-header h2 {
    margin-bottom: 10px;
}

.summary {
    font-size: 14px;
    opacity: 0.9;
}

/* Tabs Styles */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
}

.tab-btn {
    padding: 15px 25px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.tab-btn:hover {
    background: #e9ecef;
}

.tab-content {
    padding: 0;
}

.tab-pane {
    display: none;
    padding: 25px;
}

.tab-pane.active {
    display: block;
}

/* Table Controls */
.table-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 1000px;
}

.results-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e1e5e9;
    cursor: pointer;
    user-select: none;
}

.results-table th:hover {
    background: #e9ecef;
}

.results-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e1e5e9;
}

.results-table tr:hover {
    background: #f8f9fa;
}

.stock-score {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.score-high { background: #28a745; }
.score-medium { background: #ffc107; color: #212529; }
.score-low { background: #dc3545; }

/* Chart Styles */
.charts-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.chart-wrapper {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e1e5e9;
}

.chart-wrapper canvas {
    max-height: 300px;
}

/* Recommendations Styles */
.recommendations-container {
    display: grid;
    gap: 20px;
}

.recommendation-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.recommendation-card.high {
    border-left-color: #28a745;
}

.recommendation-card.medium {
    border-left-color: #ffc107;
}

.recommendation-card h4 {
    margin-bottom: 10px;
    color: #333;
}

.recommendation-card p {
    color: #666;
    margin-bottom: 5px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: modalSlideIn 0.3s;
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.stock-detail {
    display: grid;
    gap: 15px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e1e5e9;
}

.detail-label {
    font-weight: 600;
    color: #555;
}

.detail-value {
    color: #333;
}

/* Footer Styles */
.footer {
    text-align: center;
    padding: 20px;
    color: white;
    margin-top: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        min-width: auto;
    }
    
    .control-actions {
        width: 100%;
        justify-content: center;
    }
    
    .chart-row {
        grid-template-columns: 1fr;
    }
    
    .results-table {
        font-size: 12px;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .database-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav-links {
        margin-left: 0;
        justify-content: center;
    }
}