/* 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: #f5f5f5;
}

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

/* Navbar */
.navbar {
    background-color: #2c3e50;
    color: white;
    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;
}

.nav-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-menu a, .nav-menu span {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-menu a:hover {
    opacity: 0.8;
}

/* Main Content */
main {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 1rem;
}

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

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

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

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

.btn:hover {
    opacity: 0.9;
}

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

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

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

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    text-align: center;
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 400px;
}

.login-box h1 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.login-box p {
    margin-bottom: 2rem;
    color: #7f8c8d;
}

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

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filters input, .filters select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.filters input {
    flex: 1;
    min-width: 200px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: #34495e;
    color: white;
}

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

tbody tr:hover {
    background-color: #f8f9fa;
}

tbody tr {
    cursor: pointer;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-high { background-color: #e74c3c; color: white; }
.badge-medium { background-color: #f39c12; color: white; }
.badge-low { background-color: #95a5a6; color: white; }
.badge-planning { background-color: #9b59b6; color: white; }
.badge-active { background-color: #27ae60; color: white; }
.badge-on_hold { background-color: #f39c12; color: white; }
.badge-completed { background-color: #3498db; color: white; }
.badge-archived { background-color: #7f8c8d; color: white; }

/* Project Detail */
.project-detail .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.project-detail .actions {
    display: flex;
    gap: 1rem;
}

.project-overview, .project-goals, .project-kpis, 
.weekly-updates, .additional-links, .comments {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-item {
    padding: 0.5rem 0;
}

.info-item strong {
    display: block;
    color: #7f8c8d;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.empty {
    color: #95a5a6;
    font-style: italic;
}

.link-list {
    list-style: none;
}

.link-list li {
    margin-bottom: 0.5rem;
}

.link-list a {
    color: #3498db;
    text-decoration: none;
}

.link-list a:hover {
    text-decoration: underline;
}

/* Comments */
.comments-list {
    margin-bottom: 1.5rem;
}

.comment {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.comment-header strong {
    color: #2c3e50;
}

.comment-header .timestamp {
    color: #7f8c8d;
    font-size: 0.875rem;
}

.comment-text {
    color: #555;
}

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

.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 select, 
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.link-input {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.link-input input {
    flex: 1;
}

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

/* Responsive */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .filters {
        flex-direction: column;
    }

    .filters input {
        width: 100%;
    }

    .project-detail .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.5rem;
    }
}
