/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Navbar */
.navbar {
    background: #2c3e50;
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand a {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.navbar-menu a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

.navbar-menu a:hover {
    color: #3498db;
}

.navbar-user {
    color: #ecf0f1;
    font-style: italic;
}

.btn-logout {
    background: #e74c3c;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.btn-logout:hover {
    background: #c0392b;
    color: #fff !important;
}

/* Alerts/Messages */
.messages {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error,
.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: #fff;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-success {
    background: #2ecc71;
    color: #fff;
}

.btn-success:hover {
    background: #27ae60;
}

.btn-info {
    background: #1abc9c;
    color: #fff;
}

.btn-info:hover {
    background: #16a085;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm, .btn-xs {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Forms */
.form-container {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #7f8c8d;
    font-size: 0.875rem;
}

fieldset {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

legend {
    font-weight: bold;
    color: #2c3e50;
    padding: 0 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    color: #2c3e50;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.project-header h3 {
    color: #2c3e50;
    margin: 0;
}

.project-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

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

.project-description {
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.project-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.875rem;
    color: #7f8c8d;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #2c3e50;
}

.stat-success {
    color: #27ae60;
}

.stat-pending {
    color: #f39c12;
}

.stat-error {
    color: #e74c3c;
}

.project-last-migration {
    font-size: 0.875rem;
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.project-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.empty-state h2 {
    color: #7f8c8d;
    margin-bottom: 1rem;
}

/* Project View */
.project-view-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.project-view-header h1 {
    color: #2c3e50;
}

.project-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #ddd;
}

.tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    color: #7f8c8d;
}

.tab:hover {
    color: #2c3e50;
}

.tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
    font-weight: bold;
}

.tab-content {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tab-content.hidden {
    display: none;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

table th,
table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #2c3e50;
}

table tr:hover {
    background: #f8f9fa;
}

table .actions {
    display: flex;
    gap: 0.5rem;
}

.batch-actions {
    margin-top: 1rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-running {
    background: #cfe2ff;
    color: #084298;
}

.status-success {
    background: #d1e7dd;
    color: #0f5132;
}

.status-failed {
    background: #f8d7da;
    color: #842029;
}

/* Info boxes */
.info-box {
    background: #e7f3ff;
    border-left: 4px solid #3498db;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.info-box h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.info-box pre {
    background: #fff;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

/* Log View */
.log-info {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.info-row {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ecf0f1;
}

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

.info-row .label {
    font-weight: bold;
    color: #7f8c8d;
    width: 200px;
}

.info-row .value {
    flex: 1;
    color: #2c3e50;
}

.error-suggestions {
    background: #fff3cd;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.suggestion-box {
    margin-bottom: 1rem;
}

.suggestion-box h4 {
    color: #856404;
    margin-bottom: 0.5rem;
}

.suggestion-box ul {
    margin-left: 1.5rem;
}

.log-output,
.log-error {
    margin-bottom: 1.5rem;
}

.log-output pre,
.log-error pre {
    background: #2c3e50;
    color: #fff;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    max-height: 400px;
}

.log-error pre {
    background: #c0392b;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
}

.hidden {
    display: none !important;
}
