/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

#app {
    width: 100%;
    min-height: 100vh;
}

/* Screens */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Start Screen */
#start-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    /* Background Image Update */
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('images/cover01.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.start-container {
    background: rgba(255, 255, 255, 0.95); /* Slightly transparent to show bg context */
    border-radius: 20px;
    padding: 60px 80px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 500px;
    backdrop-filter: blur(5px);
}

.start-container h1 {
    font-size: 3em;
    margin-bottom: 10px;
    color: #667eea;
}

.tagline {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 40px;
}

.start-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#load-game-form {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

#load-game-form h3 {
    margin-bottom: 15px;
    color: #667eea;
}

/* Game Screen */
#game-screen {
    width: 100%;
    min-height: 100vh;
    background: #f5f7fa;
}

.game-header {
    background: white;
    padding: 20px 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    font-size: 1.8em;
    color: #667eea;
    margin-bottom: 5px;
}

.date-display {
    font-size: 1.1em;
    color: #666;
}

.header-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat-box {
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 8px;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-right: 5px;
}

.stat-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

/* Main Content Layout */
.game-content {
    display: flex;
    height: calc(100vh - 100px);
}

.sidebar {
    width: 250px;
    background: white;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.nav-btn {
    width: 100%;
    padding: 15px 20px;
    margin-bottom: 10px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.nav-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.nav-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
}

.btn-advance {
    width: 100%;
    font-size: 1.1em;
    padding: 15px;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 30px 40px;
    overflow-y: auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    font-size: 2em;
    color: #333;
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

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

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

.btn-disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9em;
}

/* Input Fields */
.input-text {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    margin-bottom: 15px;
}

.input-text:focus {
    outline: none;
    border-color: #667eea;
}

/* Overview Tab */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #667eea;
}

.info-card p {
    margin: 8px 0;
    color: #666;
}

/* Monthly Report */
.monthly-report {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 20px;
}

.monthly-report h3 {
    color: #667eea;
    margin-bottom: 20px;
}

.report-summary {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.report-stat {
    flex: 1;
}

.report-stat .label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.report-stat .value {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
}

.report-stat .positive {
    color: #48bb78;
}

.report-stat .negative {
    color: #f56565;
}

.report-events {
    margin-top: 20px;
}

.report-events h4 {
    margin-bottom: 10px;
    color: #333;
}

.report-events ul {
    list-style: none;
}

.report-events li {
    padding: 10px;
    margin: 5px 0;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

/* Employee Cards */
.employees-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.employee-card, .job-candidate {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Visual Assets Styles */
.card-header-with-avatar {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.employee-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
    background: #eee;
}

.client-logo {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: contain;
    background: #f8f9fa;
    border: 1px solid #eee;
    padding: 4px;
}

.header-info {
    flex: 1;
}

/* Updated headers to work with avatars */
.employee-header {
    /* Was previously flex, now handled by wrapper if avatar exists */
    margin-bottom: 5px;
}

.employee-header h3 {
    font-size: 1.3em;
    color: #333;
    line-height: 1.2;
    margin-bottom: 5px;
}

.employee-level {
    font-size: 0.85em;
    color: #666;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.employee-stats {
    margin-bottom: 15px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

/* Skills */
.skills-grid {
    margin: 15px 0;
}

.skill-bar {
    margin-bottom: 10px;
}

.skill-name {
    font-size: 0.9em;
    color: #666;
    display: block;
    margin-bottom: 4px;
}

.skill-progress {
    background: #f0f0f0;
    border-radius: 10px;
    height: 20px;
    position: relative;
    overflow: hidden;
}

.skill-fill {
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s;
}

.skill-value {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    font-weight: bold;
    color: #333;
}

/* Projects */
#projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.project-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.project-card h3 {
    color: #667eea;
    margin-bottom: 5px;
}

.project-card .badge {
    margin-left: 0;
    margin-bottom: 10px;
}

.project-client {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.project-stats {
    margin: 15px 0;
}

.project-skills h4 {
    font-size: 0.95em;
    margin-bottom: 10px;
    color: #666;
}

.skill-tag {
    display: inline-block;
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    margin: 4px;
}

/* Clients */
#clients-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.client-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.client-card h3 {
    color: #333;
    margin-bottom: 5px;
    line-height: 1.2;
}

.satisfaction-high {
    color: #48bb78;
}

.satisfaction-medium {
    color: #ed8936;
}

.satisfaction-low {
    color: #f56565;
}

/* Job Market */
#job-market-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.hint {
    color: #666;
    font-style: italic;
    margin-bottom: 20px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    background: #667eea;
    color: white;
    margin-left: 10px;
}

.badge-warning {
    background: #ed8936;
}

.badge-retainer {
    background: #48bb78;
}

.badge-low {
    background: #a0aec0;
}

.badge-mid {
    background: #4299e1;
}

.badge-high {
    background: #9f7aea;
}

/* Workload Indicators */
.workload-danger {
    color: #f56565;
    font-weight: bold;
}

.workload-warning {
    color: #ed8936;
    font-weight: bold;
}

.workload-low {
    color: #a0aec0;
}

.workload-ok {
    color: #48bb78;
}

/* Time Allocation Display */
.time-allocation-display {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.allocation-bars {
    margin-top: 10px;
}

.allocation-bar {
    margin-bottom: 8px;
}

.allocation-bar span {
    font-size: 0.9em;
    color: #666;
    display: block;
    margin-bottom: 3px;
}

.allocation-bar .bar {
    background: #e0e0e0;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.allocation-bar .fill {
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 100%;
    transition: width 0.3s;
}

.allocation-bar .learning-fill {
    background: linear-gradient(90deg, #48bb78, #38a169);
}

/* Work Market */
.tier-header {
    margin-top: 30px;
    margin-bottom: 15px;
    color: #667eea;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.tier-header:first-child {
    margin-top: 0;
}

.opportunity-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.opportunity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.opportunity-header h3 {
    margin: 0;
    color: #333;
}

.opportunity-client {
    color: #666;
    margin-bottom: 15px;
}

.opportunity-details {
    margin: 15px 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.difficulty-high {
    color: #f56565;
    font-weight: bold;
}

.difficulty-medium {
    color: #ed8936;
    font-weight: bold;
}

.difficulty-low {
    color: #48bb78;
    font-weight: bold;
}

.success-high {
    color: #48bb78;
    font-weight: bold;
}

.success-medium {
    color: #ed8936;
    font-weight: bold;
}

.success-low {
    color: #f56565;
    font-weight: bold;
}

.required-skills {
    margin: 15px 0;
}

/* Allocation Modal */
.allocation-controls {
    margin: 20px 0;
}

.allocation-row {
    margin-bottom: 15px;
}

.allocation-row label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-weight: 500;
}

.allocation-row input[type="range"] {
    width: 100%;
}

.allocation-total {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
}

/* Modal Updates */
.modal-content select.input-text {
    width: 100%;
    padding: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #667eea;
}

.hashcode-display {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.hashcode-display input {
    flex: 1;
}

.warning {
    color: #ed8936;
    font-size: 0.9em;
    margin: 15px 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    color: #999;
    padding: 40px;
    font-style: italic;
}

/* Error Message */
.error-message {
    color: #f56565;
    margin-top: 10px;
    font-size: 0.9em;
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification-success {
    background: #48bb78;
    color: white;
}

.notification-error {
    background: #f56565;
    color: white;
}

.notification-info {
    background: #4299e1;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-content {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
    }

    .content-area {
        padding: 20px;
    }

    .overview-grid,
    .employees-list,
    #projects-list,
    #clients-list,
    #job-market-list {
        grid-template-columns: 1fr;
    }

    .start-container {
        padding: 40px;
    }
}