:root {
    --bg-color: #d8f3dc;
    /* Light green background */
    --plot-yellow: #fceea7;
    --plot-pink: #fadadd;
    --plot-green: #90be6d;
    /* Darker green for trees/buffer */
    --road-color: #3b3b3b;
    --water-color: #a2d2ff;
    --border-color: #555;
    --text-color: #a42424;
    /* Maroon for numbers */
}

body {
    background-color: var(--bg-color);
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    /* Allow horizontal scroll for large map */
}

.layout-wrapper {
    min-width: 1600px;
    /* Force desktop width for detail */
    background: #eafcf0;
    padding: 20px;
    border: 5px solid #2d6a4f;
    position: relative;
}

/* Header */
.layout-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    border-left: 5px solid #2d6a4f;
    padding-left: 15px;
}

.butterfly-icon {
    font-size: 3rem;
    color: #881e3a;
    /* Dark red/purple */
}

.header-details {
    max-width: 500px;
    background: rgba(255, 255, 255, 0.5);
    padding: 10px;
    border-radius: 5px;
}

/* Map Container */
.map-container {
    display: grid;
    /* 
       Col 1: Channel (60px)
       Col 2: Main Layout + Right Cluster (Auto/Fr)
       Col 3: Highway (100px)
    */
    grid-template-columns: 60px 1fr 100px;
    gap: 0;
    /* Align Highway directly to the grid */
    position: relative;
    border: 2px solid #333;
    padding: 10px;
    background: #b7e4c7;
}

/* Field Channel */
.field-channel {
    background: var(--water-color);
    border-right: 2px solid #005f73;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.channel-water {
    height: 100%;
    width: 100%;
    background-image: repeating-linear-gradient(45deg,
            transparent,
            transparent 10px,
            rgba(255, 255, 255, 0.3) 10px,
            rgba(255, 255, 255, 0.3) 20px);
}

.channel-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-weight: bold;
    color: #005f73;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(180deg);
    white-space: nowrap;
}

/* Layout Grid System - Unified */
.layout-grid {
    display: grid;
    /* 
       Columns: 
       1. Left Block (X fr)
       2. Center Vert Road (50px)
       3. Right Block (Y fr)
       4. Buffer/Village Road (40px)
       5. Far Right (Plot 1/Village) (300px)
    */
    grid-template-columns: 1.2fr 50px 0.8fr 40px 300px;
    /* 
       Rows: 
       Same as before but 12m road (Row 5) will span all columns.
    */
    grid-template-rows: auto auto 40px auto 50px auto 40px auto;
    gap: 5px;
}

/* Roads */
.road {
    background: var(--road-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    text-transform: uppercase;
    position: relative;
}

.road::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    border-top: 2px dashed #fff;
    transform: translateY(-50%);
}

.road-horizontal {
    grid-column: 1 / -1;
    /* default span all */
}

.road-vertical {
    grid-row: 3 / 9;
    /* Start from Road 1 (Row 3) downwards, skip Row 2 */
    grid-column: 2;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    border-left: 2px dashed #fff;
    border-right: 2px dashed #fff;
    background: var(--road-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.green-strip-vertical {
    grid-column: 2;
    grid-row: 2;
    /* Between plots 6 & 7 */
    background: #90be6d;
    /* Green */
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 0.7rem;
    font-weight: bold;
    color: #333;
    border: 1px solid #555;
}

.road-vertical span {
    background: var(--road-color);
    /* mask line */
    padding: 5px;
    z-index: 1;
}

.road-label-center {
    background: var(--road-color);
    padding: 0 10px;
    z-index: 1;
}

/* Plots Generic */
.plot-row {
    display: flex;
    justify-content: space-between;
    /* Distribute evenly */
    gap: 2px;
    margin-bottom: 2px;
}

.plot {
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--text-color);
    min-width: 30px;
    min-height: 138px;

    position: relative;
    flex: 1;
    /* evenly stretch */
}

.plot-yellow {
    background-color: var(--plot-yellow);
}

.plot-pink {
    background-color: var(--plot-pink);
}

.plot-green {
    background-color: #a8d5ba;
}

/* Specific Rows Positioning */
/* Top Left Block (19-7) */
.row-top-left {
    grid-column: 1;
    grid-row: 2;
}

/* Top Right Block (6-2) */
.row-top-right {
    grid-column: 3;
    grid-row: 2;
}

/* Road 1 Overrides */
/* Road 1 Overrides */
.road-1 {
    grid-row: 3;
    grid-column: 1 / 4;
    /* Span Left(1), Center(2), Right(3) - Stop at Buffer(4) */
}

/* Mid Left Top (20-33) */
.row-mid-left-top {
    grid-column: 1;
    grid-row: 4;
    align-self: start;
    margin-bottom: 0;
    /* Removing margin to stick to next row */
}

/* Mid Left Bottom (57-44) */
.row-mid-left-bottom {
    grid-column: 1;
    grid-row: 4;
    align-self: end;
}

/* Mid Right Top (34-38) */
.row-mid-right-top {
    grid-column: 3;
    grid-row: 4;
    align-self: start;
}

.row-mid-right-bottom {
    grid-column: 3;
    grid-row: 4;
    align-self: end;
}

/* Road 2 Middle */
.road-2 {
    grid-row: 5;
}

/* Bot Left Top (58-70) */
.row-bot-left-top {
    grid-column: 1;
    grid-row: 6;
    align-self: start;
}

.row-bot-left-bottom {
    grid-column: 1;
    grid-row: 6;
    align-self: end;
}

/* Bot Right Top (71-80) */
.row-bot-right-top {
    grid-column: 3;
    grid-row: 6;
    align-self: start;
}

.row-bot-right-bottom {
    grid-column: 3;
    grid-row: 6;
    align-self: end;
}

/* Green Buffer / Village Road (Col 4) */
.road-buffer-vertical {
    grid-column: 4;
    grid-row: 6 / 9;
    /* Start below 12m road, span down to footer */
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    background: var(--plot-green);
    border: 1px dashed #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
    z-index: 1;
}

/* Far Right Items (Col 5) */
.far-right-top {
    grid-column: 5;
    grid-row: 4 / 5;
    /* Align with Mid Plots (Row 4), leaving Top (Row 2-3) empty */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Ensure it stays towards the bottom of the cell if there's extra space, or just fill */
}

.far-right-bottom {
    grid-column: 5;
    grid-row: 6 / 9;
    /* Below 12m road down to bottom */
    display: flex;
    flex-direction: column;
}

/* Adjust Right Block to sit in Col 3 */
.row-top-right,
.row-mid-right-top,
.row-mid-right-bottom,
.row-bot-right-top,
.row-bot-right-bottom,
.row-footer-right {
    grid-column: 3;
}

.road-3 {
    grid-row: 7;
    grid-column: 1 / 4;
    /* Span Left(1), Center(2), Right(3) - Stop at Buffer(4) */
    background: var(--road-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    text-transform: uppercase;
    position: relative;
    border-top: 2px dashed #fff;
    /* dashed line style */
}

/* Ensure generic horizontal road doesn't override if specificity issues arise, 
   but specific class usually wins. 
   Actually .road-horizontal has grid-column: 1 / -1. 
   We need to remove .road-horizontal class from HTML for road-3 or override here with !important or just higher specificity.
   Let's check HTML. road-3 has `road road-horizontal road-3`. 
   So we need to make sure this rule wins.
*/

/* Footer Rows */
.row-footer-left {
    grid-column: 1;
    grid-row: 8;
}

.row-footer-right {
    grid-column: 3;
    grid-row: 8;
}


/* Right Cluster (Village, Plot 1) */
.right-cluster {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Plot 1 & Amenities Area */
.plot-1-area {
    background: repeating-linear-gradient(135deg,
            #fceea7,
            #fceea7 10px,
            #e9dba0 10px,
            #e9dba0 20px);
    /* Yellowish hatching effect */
    border: 2px solid #555;
    height: 180px;
    /* Adjust height to fit dimensions */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.plot-1-circle {
    width: 40px;
    height: 40px;
    background: #ffc0cb;
    /* Pink */
    border-radius: 50%;
    border: 2px solid #555;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    color: #a42424;
    z-index: 2;
}

.amenities-label {
    position: absolute;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-weight: bold;
    font-size: 0.9rem;
    left: 20px;
    color: #a42424;
}

/* Dimensions for Plot 1 */
.dim-label {
    position: absolute;
    font-size: 0.7rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.7);
    padding: 1px 3px;
}

.dim-top {
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.dim-bottom {
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
}

.dim-left {
    left: -25px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
}

.dim-right {
    right: -25px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
}

.open-space-small {
    background: #90be6d;
    /* Green */
    border: 2px solid #555;
    margin-bottom: 25px;
    /* Space for dims */
    position: relative;
}

.velinuthala-village {
    background: var(--plot-pink);
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid #333;
}

.green-buffer {
    background: var(--plot-green);
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #333;
}

.vertical-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

/* Highway */
.highway-container {
    background: #444;
    color: #fff;
    writing-mode: vertical-rl;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 2px dashed yellow;
    border-right: 2px dashed yellow;
}

.highway-text {
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 2px;
}

/* APCRDA Badge */
.apcrda-badge {
    position: absolute;
    top: 150px;
    right: 250px;
    /* Adjust based on container width */
    text-align: center;
    z-index: 10;
}

.badge-seal {
    background: radial-gradient(circle, #ff0000 0%, #cc0000 100%);
    color: white;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 4px solid #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transform: rotate(-10deg);
}

/* Dimensional styling (Optional refinement) */
/* Vertical Road Separating Village */
.road-village-vertical {
    grid-column: 3;
    grid-row: 1 / 2;
    /* Will need to span appropriately, but map-container is not using rows for main structure, just columns. 
                        Wait, map-container children are flex items effectively in those columns. 
                        We need this road to stretch. */
    background: var(--road-color);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    border-left: 2px dashed #fff;
    border-right: 2px dashed #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.plot small {
    display: block;
    font-size: 0.5rem;
    font-weight: normal;
}