/* General Body & Typography */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
    color: #374151;
    line-height: 1.6;
}

.container {
    max-width: 1200px; /* Increased max-width for BMC layout */
    margin: 0 auto;
    padding: 20px;
}

/* Header Styling */
.main-header {
    position: fixed; /* Make header sticky */
    top: 0; /* Position at the top */
    width: 100%; /* Full width */
    height: 80px; /* Fixed height */
    display: flex;
    align-items: center;
    justify-content: center; /* Center content horizontally */
    background: linear-gradient(90deg, #10B981, #34D399, #10B981);
    background-size: 200% 100%;
    animation: gradientShift 8s ease infinite;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000; /* Ensure it stays on top */
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Footer Styling */
.footer-bg {
    background-color: #1f2937;
}

/* Input Fields & Buttons */
input[type="text"],
textarea,
select {
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem; /* Tailwind rounded-md */
    font-size: 1em;
    color: #374151;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    border-color: #10B981; /* Tailwind green-500 */
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); /* green-500 with opacity */
    outline: none;
}

/* Modal Styling (for custom alerts) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%; /* Responsive width */
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    text-align: center;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Loading Spinner */
.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #10B981;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    display: none; /* Hidden by default */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* BMC Input Card Styling */
.bmc-input-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb; /* border-gray-200 */
    border-radius: 0.5rem; /* rounded-lg */
    padding: 1.5rem; /* p-6 */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06); /* shadow-md */
}

/* BMC Display Grid Layout */
.bmc-canvas-grid {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 2fr 1.5fr 1.5fr; /* 5 columns with varying widths */
    grid-template-rows: repeat(3, minmax(150px, auto)); /* 3 rows, min height 150px */
    gap: 1px; /* Thin borders between cells */
    border: 1px solid #d1d5db; /* Outer border */
    background-color: #d1d5db; /* Color for grid lines */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    overflow: hidden; /* Ensures rounded corners apply correctly */
}

.bmc-cell {
    background-color: #ffffff;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
}

.bmc-cell-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #1f2937; /* gray-900 */
    font-size: 1.1em;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.3rem;
    width: 100%;
}

.bmc-cell-content {
    font-size: 0.9em;
    color: #4b5563; /* gray-700 */
    white-space: pre-wrap; /* Preserves whitespace and line breaks */
    word-wrap: break-word; /* Breaks long words */
    flex-grow: 1; /* Allows content to take available space */
}

/* Specific Grid Area Assignments */
#keyPartnersDisplay {
    grid-area: 1 / 1 / 3 / 2; /* Row 1 to 3, Column 1 to 2 */
}
#keyActivitiesDisplay {
    grid-area: 1 / 2 / 2 / 3; /* Row 1 to 2, Column 2 to 3 */
}
#keyResourcesDisplay {
    grid-area: 2 / 2 / 3 / 3; /* Row 2 to 3, Column 2 to 3 */
}
#valuePropositionsDisplay {
    grid-area: 1 / 3 / 3 / 4; /* Row 1 to 3, Column 3 to 4 (center) */
}
#customerRelationshipsDisplay {
    grid-area: 1 / 4 / 2 / 5; /* Row 1 to 2, Column 4 to 5 */
}
#channelsDisplay {
    grid-area: 2 / 4 / 3 / 5; /* Row 2 to 3, Column 4 to 5 */
}
#customerSegmentsDisplay {
    grid-area: 1 / 5 / 3 / 6; /* Row 1 to 3, Column 5 to 6 */
}
#costStructureDisplay {
    grid-area: 3 / 1 / 4 / 3; /* Row 3 to 4, Column 1 to 3 */
}
#revenueStreamsDisplay {
    grid-area: 3 / 4 / 4 / 6; /* Row 3 to 4, Column 4 to 6 */
}

/* Responsive adjustments for smaller screens */
@media (max-width: 1024px) { /* Adjust for smaller desktops and tablets */
    .bmc-canvas-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for smaller screens */
        grid-template-rows: auto; /* Auto rows */
    }
    .bmc-cell {
        grid-area: auto !important; /* Reset grid areas for stacking */
    }
}

@media (max-width: 768px) { /* Adjust for tablets and mobile */
    .bmc-canvas-grid {
        grid-template-columns: 1fr; /* Single column for mobile */
    }
}
