/* Page header (matching project-settings style) */
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 24px; font-weight: 700; color: #1e293b; display: flex; align-items: center; gap: 12px; margin: 0 0 6px 0; }
.page-header h1 i { color: #6366f1; }
.page-subtitle { color: #64748b; font-size: 14px; margin: 0; }

/* Database Connections Styles */
.database-list-container {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.database-list-header {
    display: grid;
    grid-template-columns: 20% 15% 25% 20% 20%;
    padding: 15px;
    background-color: #f7f9fc;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    color: #4a5568;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.database-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.database-item {
    display: grid;
    grid-template-columns: 20% 15% 25% 20% 20%;
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s;
    align-items: center;
}

.database-item:hover {
    background-color: #f8fafc;
}

.database-item:last-child {
    border-bottom: none;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.database-name, .database-type, .database-host, .database-dbname {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 10px;
}

.database-name {
    font-weight: 500;
    color: #2d3748;
}

.database-type {
    color: #4a5568;
}

.database-host, .database-dbname {
    color: #718096;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.database-actions {
    display: flex;
    justify-content: flex-end;
}

.database-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    color: #555;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 6px;
}

.database-action:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
}

.database-action.edit-database {
    color: #4299e1;
}

.database-action.edit-database:hover {
    background-color: rgba(66, 153, 225, 0.1);
}

.database-action.delete-database {
    color: #e53e3e;
}

.database-action.delete-database:hover {
    background-color: rgba(229, 62, 62, 0.1);
}

.database-action.analyze-database {
    color: #38a169;
}

.database-action.analyze-database:hover {
    background-color: rgba(56, 161, 105, 0.1);
}

.database-action.query-database {
    color: #805ad5;
}

.database-action.query-database:hover {
    background-color: rgba(128, 90, 213, 0.1);
}

.database-action.export-download {
    color: #2563eb;
}

.database-action.export-download:hover {
    background-color: rgba(37, 99, 235, 0.1);
}

.database-action.export-source {
    color: #d97706;
}

.database-action.export-source:hover {
    background-color: rgba(217, 119, 6, 0.1);
}

/* Schema Display Styles */
.database-schema {
    grid-column: 1 / -1;
    padding: 20px;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    margin-top: 0;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tables-list, .procedures-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.table-item, .procedure-item {
    padding: 12px 15px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.table-item:hover, .procedure-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-color: #cbd5e1;
}

.table-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-meta {
    font-size: 12px;
    color: #718096;
    display: flex;
    justify-content: space-between;
}

/* Modal Styles for Table Details */
.table-details-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.table-details-section {
    margin-bottom: 25px;
}

.table-details-section h4 {
    margin: 0 0 15px 0;
    font-size: 15px;
    font-weight: 600;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border: 1px solid #e2e8f0;
}

.data-table th {
    background-color: #f8fafc;
    padding: 10px 15px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table tr:hover {
    background-color: #f8fafc;
}

/* Responsive */
@media (max-width: 1024px) {
    .database-list-header,
    .database-item {
        grid-template-columns: 25% 20% 30% 25%;
    }
    .database-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-top: 10px;
        margin-top: 10px;
        border-top: 1px dashed #e2e8f0;
    }
}

@media (max-width: 768px) {
    .database-list-header {
        display: none;
    }
    
    .database-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .database-item > div {
        width: 100%;
    }
    
    .database-actions {
        margin-top: 10px;
        border-top: 1px solid #f1f5f9;
        padding-top: 10px;
    }
}