/* CSS Variables */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --danger-color: #dc3545;
    --text-color: #333;
    --text-muted: #6c757d;
    --bg-color: #f8f9fa;
    --card-bg: #fff;
    --border-color: #e0e0e0;
    --hover-bg: #f5f5f5;
    --primary-light: #e7f3ff;
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: var(--bg-color);
}

/* Header navigation */
.app-header {
    background-color: #1a1a1a;
    color: #fff;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.app-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
}

.app-header .brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s;
}

.app-header .brand:hover {
    opacity: 0.8;
}

.app-header nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.app-header .nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    margin: 0;
}

.app-header .nav-links a {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.2s;
    padding: 0.5rem 0;
}

.app-header .nav-links a:hover {
    color: #fff;
}

/* User menu dropdown */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    background: none;
    border: none;
    color: #e0e0e0;
    cursor: pointer;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.user-menu-toggle:hover {
    background-color: rgba(255,255,255,0.1);
}

.user-menu-toggle::after {
    content: '▾';
    font-size: 0.8rem;
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-width: 180px;
    display: none;
    z-index: 1000;
}

.user-menu-dropdown.show {
    display: block;
}

.user-menu-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}

.user-menu-dropdown a:hover {
    background-color: #f5f5f5;
}

/* Main content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Container */
.container {
    width: 100%;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #1a1a1a;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #545b62;
}

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

.btn-danger:hover {
    background-color: #c82333;
}

/* Alerts */
.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;
}

/* Projects grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Project card */
.project-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.project-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.project-card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.project-card-body {
    margin-bottom: 1.5rem;
}

.project-meta {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.project-personas-count {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
}

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

.project-card-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

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

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

.form-control {
    width: 100%;
    padding: 0.625rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

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

/* Project details */
.project-details {
    margin-top: 2rem;
}

.project-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.project-info p {
    margin-bottom: 0.5rem;
    color: #495057;
}

.project-info p:last-child {
    margin-bottom: 0;
}

/* Personas section */
.personas-section {
    margin-top: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
}

.section-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

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

/* Persona card */
.persona-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.persona-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.persona-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.persona-meta {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Back link */
.back-link {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.back-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

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

/* Dashboard */
.dashboard-welcome {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.dashboard-welcome h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.dashboard-welcome p {
    margin-bottom: 1rem;
    color: #495057;
}

.dashboard-welcome .alert {
    margin-top: 1rem;
    margin-bottom: 0;
}

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

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

.action-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.action-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.action-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.action-card p {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Persona forms */
.persona-form {
    max-width: 800px;
}

.form-section {
    margin-bottom: 2.5rem;
}

.form-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e0e0e0;
}

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

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

.subtitle {
    font-size: 1rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Persona details */
.persona-details {
    margin-top: 2rem;
}

.persona-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.persona-avatar {
    flex-shrink: 0;
}

.avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 600;
}

.persona-basic-info {
    flex: 1;
}

.persona-meta-large {
    font-size: 1.125rem;
    color: #6c757d;
    margin: 0;
}

.persona-quote {
    background: #fff;
    border-left: 4px solid #007bff;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.persona-quote blockquote {
    margin: 0;
    font-size: 1.25rem;
    font-style: italic;
    color: #333;
    line-height: 1.6;
}

.persona-sections {
    display: grid;
    gap: 2rem;
}

.persona-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.persona-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.persona-section p {
    color: #495057;
    line-height: 1.8;
}

.persona-metadata {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.persona-metadata p {
    margin-bottom: 0.5rem;
    color: #6c757d;
    font-size: 0.875rem;
}

.persona-metadata p:last-child {
    margin-bottom: 0;
}

.persona-quote-preview {
    font-size: 0.875rem;
    color: #6c757d;
    font-style: italic;
    margin-top: 0.75rem;
    margin-bottom: 0;
}

/* Clickable cards */
.clickable {
    cursor: pointer;
}

.clickable:hover {
    transform: translateY(-2px);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .app-header .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .app-header nav {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .app-header .nav-links {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }

    .user-menu {
        width: 100%;
    }

    .user-menu-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .persona-header {
        flex-direction: column;
        text-align: center;
    }

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

    .page-header > div {
        width: 100%;
    }

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