/* Business Model Canvas Strategizer - Styles */

:root {
    --primary-color: #1EC6B0;
    --primary-dark: #17a294;
    --primary-light: #e8f9f7;
    --danger-color: #e74c3c;
    --danger-dark: #c0392b;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --bg-color: #f8f9fa;
    --white: #ffffff;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-small: 4px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.project-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-selector select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    font-size: 0.9rem;
    background: var(--white);
    cursor: pointer;
    min-width: 180px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    background: var(--white);
    color: var(--text-color);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    background: var(--bg-color);
    border-color: var(--text-light);
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background: var(--danger-color);
    color: var(--white);
}

.btn-small {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
}

.btn-icon {
    font-size: 0.75rem;
}

/* Guided Mode Banner */
.guided-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.guided-banner.hidden {
    display: none;
}

.guided-content {
    flex: 1;
}

.guided-step {
    font-size: 0.8rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.guided-banner h2 {
    font-size: 1.25rem;
    margin: 0.25rem 0;
}

.guided-banner p {
    font-size: 0.95rem;
    opacity: 0.95;
    margin-top: 0.25rem;
}

.guided-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.guided-actions .btn {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    color: var(--white);
}

.guided-actions .btn:hover {
    background: rgba(255,255,255,0.3);
}

.guided-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.guided-actions .btn-primary {
    background: var(--white);
    color: var(--primary-color);
    border-color: var(--white);
}

.guided-actions .btn-primary:hover {
    background: var(--primary-light);
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    overflow: auto;
}

/* Canvas Grid - Matches BMC Layout */
.canvas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 0.6fr;
    gap: 0;
    background: var(--white);
    border: 2px solid var(--text-color);
    border-radius: var(--radius);
    min-height: 600px;
    height: calc(100vh - 180px);
}

/* Block Positioning */
.block-partners {
    grid-column: 1;
    grid-row: 1 / 3;
}

.block-activities {
    grid-column: 2;
    grid-row: 1;
}

.block-resources {
    grid-column: 2;
    grid-row: 2;
}

.block-value {
    grid-column: 3;
    grid-row: 1 / 3;
}

.block-relationships {
    grid-column: 4;
    grid-row: 1;
}

.block-channels {
    grid-column: 4;
    grid-row: 2;
}

.block-segments {
    grid-column: 5;
    grid-row: 1 / 3;
}

.block-costs {
    grid-column: 1 / 3;
    grid-row: 3;
}

.block-revenue {
    grid-column: 3 / 6;
    grid-row: 3;
}

/* Canvas Block Styles */
.canvas-block {
    border: 1px solid var(--text-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.canvas-block:hover {
    z-index: 1;
}

.canvas-block.highlight {
    box-shadow: inset 0 0 0 3px var(--primary-color);
    z-index: 2;
}

.block-header {
    padding: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex-shrink: 0;
}

.block-number {
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.block-header h3 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-color);
    line-height: 1.3;
}

.block-content {
    flex: 1;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cards-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 0.25rem;
}

/* Card Styles */
.card {
    background: #fffacd;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-small);
    font-size: 0.85rem;
    line-height: 1.4;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    word-wrap: break-word;
}

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

.card:nth-child(2n) {
    background: #ffd1dc;
}

.card:nth-child(3n) {
    background: #c1f0c1;
}

.card:nth-child(5n) {
    background: #add8e6;
}

/* Add Card Button */
.add-card-btn {
    margin-top: auto;
    padding: 0.5rem;
    background: transparent;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-small);
    color: var(--text-light);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.add-card-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-light);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-small {
    max-width: 360px;
}

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 1.25rem;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.modal-footer .btn-danger {
    margin-right: auto;
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.prompt-hint {
    background: var(--primary-light);
    border-left: 3px solid var(--primary-color);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--text-color);
    border-radius: 0 var(--radius-small) var(--radius-small) 0;
}

.prompt-hint strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--primary-dark);
}

/* Scrollbar Styling */
.cards-container::-webkit-scrollbar {
    width: 4px;
}

.cards-container::-webkit-scrollbar-track {
    background: transparent;
}

.cards-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.cards-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 1200px) {
    .canvas-grid {
        min-height: 500px;
        height: auto;
    }
}

@media (max-width: 900px) {
    .canvas-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }

    .block-partners { grid-column: 1; grid-row: 1; }
    .block-activities { grid-column: 2; grid-row: 1; }
    .block-resources { grid-column: 1; grid-row: 2; }
    .block-value { grid-column: 2; grid-row: 2; }
    .block-relationships { grid-column: 1; grid-row: 3; }
    .block-channels { grid-column: 2; grid-row: 3; }
    .block-segments { grid-column: 1 / 3; grid-row: 4; }
    .block-costs { grid-column: 1; grid-row: 5; }
    .block-revenue { grid-column: 2; grid-row: 5; }

    .canvas-block {
        min-height: 180px;
    }

    .app-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    .canvas-grid {
        grid-template-columns: 1fr;
    }

    .block-partners,
    .block-activities,
    .block-resources,
    .block-value,
    .block-relationships,
    .block-channels,
    .block-segments,
    .block-costs,
    .block-revenue {
        grid-column: 1;
        grid-row: auto;
    }

    .guided-banner {
        flex-direction: column;
        text-align: center;
    }

    .guided-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* FAQ Section */
.faq-section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 1.5rem;
    padding: 1.5rem 2rem;
}

.faq-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem 1.25rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-color);
    transition: background 0.2s ease;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--primary-color);
    transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
    content: '-';
}

.faq-item summary:hover {
    background: var(--primary-light);
}

.faq-item[open] summary {
    background: var(--primary-light);
    border-bottom: 1px solid var(--border-color);
}

.faq-answer {
    padding: 1rem 1.25rem;
    line-height: 1.6;
    color: var(--text-color);
}

.faq-answer p {
    margin: 0;
}

@media (max-width: 600px) {
    .faq-section {
        padding: 1rem;
    }

    .faq-item summary {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }

    .faq-answer {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    .app-header,
    .guided-banner,
    .add-card-btn,
    .modal,
    .faq-section {
        display: none !important;
    }

    .app-container {
        padding: 0;
    }

    .canvas-grid {
        height: auto;
        min-height: auto;
        page-break-inside: avoid;
    }

    .canvas-block {
        break-inside: avoid;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
