/* --- START: NEW UTILITY CLASS FOR VISIBILITY CONTROL --- */
.srr-display-controlled-hidden {
    display: none !important;
}
/* --- END: NEW UTILITY CLASS --- */

/* Basic Styles for Smart Road Reporter */
.srr-report-container{
    font-family:Tahoma,Arial,sans-serif;
    direction:rtl;
    text-align:right;
    background-color:#f9f9f9;
    padding:20px;
    border-radius:8px;
    box-shadow:0 2px 8px rgba(0,0,0,.1);
    max-width:700px; 
    margin:20px auto;
    color:#333
}

.srr-main-header-group{
    text-align:center;
    margin-bottom:10px
}

.srr-report-main-title{
    color:#212529; 
    font-size:1.7em;
    margin-bottom:3px;
    font-weight: bold;
}

.srr-report-meta-condensed{
    font-size:.95em;
    color:#555;
    margin-top:0;
    line-height:1.4;
    text-align:center;
    font-family:Arial,sans-serif;
    font-weight:400
}

/* --- START: NEW - Quick Search Field Styles --- */
.srr-quick-search-wrapper {
    position: relative;
    max-width: 450px;
    margin: 15px auto;
    display: flex;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    background-color: #fff;
    border: 1px solid #ddd;
    display:none; /* Hidden by default, shown by JS if enabled */
}
#srr-quick-search-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: none;
    outline: none;
    font-size: 1em;
    direction: rtl; 
    text-align: right;
}
#srr-quick-search-input::placeholder {
    color: #aaa;
}
#srr-quick-search-clear {
    flex-shrink: 0;
    width: 40px;
    background-color: #fff;
    color: #999;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2em;
    transition: background-color 0.2s;
    display: none; /* Hidden by default, shown when text is present */
}
#srr-quick-search-clear:hover {
    background-color: #f0f0f0;
}
/* --- END: NEW - Quick Search Field Styles --- */


/* --- START: Add City Group Button Style --- */
.srr-add-new-item-wrap {
    text-align: center;
    margin-bottom: 20px;
}
.srr-action-button-add {
    background-color: #28a745;
    color: #fff;
    border-color: #218838;
}
.srr-action-button-add:hover {
    background-color: #218838;
}
/* --- END: Add City Group Button Style --- */


/* City Section (Entry) Styles */
.srr-city-section{
    border:1px solid #e0e0e0;
    border-radius:6px;
    margin-bottom:15px;
    overflow:hidden;
    background-color:#fff
}

.srr-city-section-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:10px 15px;
    background-color:#f5f5f5;
    border-bottom:1px solid #e0e0e0;
    cursor:pointer;
    transition:background-color .2s
}
.srr-city-section-header:hover{
    background-color:#eee
}

.srr-city-report-title{
    margin:0;
    font-size:1.3em;
    font-weight:600;
    color:#212529;
    flex-grow:1;
    display:flex;
    align-items:center
}
.srr-city-group-icon{
    font-size:1.2em;
    margin-left:8px
}

.srr-city-section-actions{
    flex-shrink:0;
    display:flex;
    align-items:center
}

.srr-action-button{
    background-color:#f8f9fa;
    color:#333;
    border:1px solid #ccc;
    border-radius:4px;
    padding:5px 10px;
    margin-left:5px;
    cursor:pointer;
    font-size:.9em;
    font-weight:600;
    text-decoration:none;
    display:inline-block;
    transition:all .2s;
    line-height:1.2;
    white-space:nowrap;
    box-shadow:0 1px 2px rgba(0,0,0,.05)
}
.srr-action-button:hover{
    background-color:#e2e6ea;
    border-color:#adadad;
    color:#000
}

.collapsible-trigger{
    font-size:1.2em;
    padding:4px 8px
}
.icon-expanded,.srr-expanded .icon-collapsed{
    display:none
}
.srr-expanded .icon-expanded{
    display:inline
}

/* Road Items (Region) Styles */
.collapsible-content{
    padding:15px;
    padding-top:5px;
}

.srr-road-item{
    display:flex;
    flex-wrap:wrap;
    justify-content:space-between;
    align-items:center;
    padding:10px 15px;
    margin-bottom:8px;
    border:1px solid #f0f0f0;
    border-radius:4px;
    background-color:#fafafa;
    box-shadow:0 1px 3px rgba(0,0,0,.05);
    position: relative; /* For the road area image container */
}

.srr-road-item-content{
    flex-grow:1;
    display:flex;
    align-items:center;
    min-width:50%
}
.srr-road-status-icon{
    font-size:1.2em;
    margin-left:8px;
    line-height:1
}
.srr-road-item-title{
    font-weight:600;
    margin-left:5px;
    color:#333
}
.srr-road-status-text{
    font-size:.9em;
    color:#666
}

.srr-road-item-actions{
    flex-shrink:0;
    display:flex;
    align-items:center;
    margin-right:15px;
}

.srr-road-item-meta{
    flex-basis:100%;
    text-align:left;
    font-size:.85em;
    color:#999;
    margin-top:5px
}

/* Status Colors (Examples) */
.srr-road-status-open{
    border-right:5px solid #28a745
}
.srr-road-status-closed{
    border-right:5px solid #dc3545
}
.srr-road-status-caution{
    border-right:5px solid #ffc107
}

/* Quick Update Composer */
.srr-quick-update-composer{
    border:1px dashed #ccc;
    padding:15px;
    margin-top:15px;
    border-radius:4px;
    background-color:#fcfcfc
}
.srr-quick-update-composer h3{
    margin-top:0;
    font-size:1.2em;
    color:#0073aa
}
.srr-quick-update-composer select{
    width:100%;
    padding:8px;
    border:1px solid #ddd;
    border-radius:4px;
    margin-bottom:10px
}
.srr-quick-update-actions{
    display:flex;
    justify-content:flex-start;
    align-items:center;
    flex-wrap:wrap;
    margin-top:10px
}
.srr-quick-update-actions .srr-action-button{
    margin-top:0
}
.srr-action-button-primary{
    background-color:#0073aa;
    color:#fff;
    border-color:#006799
}
.srr-action-button-primary:hover{
    background-color:#005177
}
.srr-action-button-secondary{
    background-color:#f0f0f1;
    color:#333;
    border-color:#999
}
.srr-action-button-secondary:hover{
    background-color:#e0e0e0
}

.srr-nav-buttons-container{
    margin-right:auto;
    display:flex;
    align-items:center
}
.srr-nav-button{
    background:none;
    border:none;
    color:#0073aa;
    cursor:pointer;
    font-size:.9em;
    padding:5px 10px;
    text-decoration:underline
}
.srr-nav-button:hover{
    color:#005177
}


/* --- START: NEW IMAGE GENERATION STYLES (REQUIRED) --- */

/* Styling for the new temporary image container (Entry) */
.srr-temporary-image-container {
    margin-top: 5px;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f0f0f0; /* Light background to distinguish it */
    border: 1px solid #ddd;
    border-radius: 5px;
    display: none; /* Initially hidden, shown by JS */
    position: relative; /* For positioning the close button */
    overflow: hidden; 
}

/* Styling for the new temporary image container (Region) */
.srr-temporary-image-container-road-area {
    /* Full width inside the road item div, positioned at the bottom */
    flex-basis: 100%; 
    margin-top: 10px;
    padding: 10px;
    background-color: #fcfcfc; 
    border-top: 1px dashed #ccc;
    border-radius: 0 0 4px 4px;
    position: relative;
    overflow: hidden;
    display: none; /* Initially hidden, shown by JS */
}

/* Styling for the generated image wrapper */
.srr-generated-image-wrapper {
    text-align: center;
    padding: 5px;
}

/* Styling for the generated image itself */
.srr-generated-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
    box-shadow: 0 4px 10px rgba(0,0,0,.1);
    border-radius: 5px;
}

/* Loading/Error Messages */
.srr-image-loading-message,
.srr-image-error-message {
    text-align: center;
    padding: 15px;
    font-weight: bold;
    color: #0073aa; /* WP Blue */
}
.srr-image-error-message {
    color: #dc3232; /* WP Red */
}

/* Close button for the temporary container */
.srr-close-temp-image-container-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    cursor: pointer;
    font-size: 1.2em;
    color: #999;
    padding: 5px;
    line-height: 1;
    z-index: 10;
    background: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: all 0.2s;
}
.srr-close-temp-image-container-btn:hover {
    color: #333;
    transform: scale(1.1);
}

/* Style for the new download button (using primary button style) */
.srr-download-image-button {
    background-color: #28a745; /* Green for download */
    color: #fff;
    border: 1px solid #218838;
    margin-top: 10px;
}
.srr-download-image-button:hover {
    background-color: #218838;
}

/* Style for the new image buttons icons */
.srr-generate-image-button .srr-image-action-icon {
    font-size: 1.2em; 
}

/* Loading State for Buttons */
.srr-action-button.srr-is-loading {
    opacity: 0.6;
    pointer-events: none;
    cursor: wait;
}

/* --- END: NEW IMAGE GENERATION STYLES --- */


/* Main Footer Actions */
.srr-main-actions-footer{
    display:flex;
    justify-content:center;
    gap:10px;
    margin-top:20px;
    padding-top:15px;
    border-top:1px solid #eee;
    flex-wrap:wrap
}
.srr-main-actions-footer .srr-action-button{
    min-width:150px
}

#srr-full-report-image-output{
    margin-top:20px;
    text-align:center
}

/* Search Highlight */
.srr-road-item.srr-search-highlight{
    box-shadow:0 0 5px rgba(255,193,7,1);
    animation:highlight-pulse .5s ease-in-out forwards;
    border-left:5px solid #ffc107!important
}
@keyframes highlight-pulse{
    0%{
        box-shadow:0 0 5px rgba(255,193,7,.5)
    }
    100%{
        box-shadow:0 0 5px rgba(255,193,7,1)
    }
}
.srr-road-item.srr-search-hidden{
    display:none!important
}
.srr-city-section.srr-search-hidden{
    display:none!important
}

/* Modals */
.srr-modal{
    position:fixed;
    z-index:100000;
    left:0;
    top:0;
    width:100%;
    height:100%;
    overflow:auto;
    background-color:rgba(0,0,0,.4);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px
}

.srr-modal-content{
    background-color:#fefefe;
    padding:25px;
    border:1px solid #888;
    width:90%;
    max-width:500px;
    border-radius:8px;
    position:relative;
    box-shadow:0 4px 8px 0 rgba(0,0,0,.2),0 6px 20px 0 rgba(0,0,0,.19);
    direction:rtl;
    text-align:right
}

.srr-close-modal{
    color:#aaa;
    float:left;
    font-size:28px;
    font-weight:700;
    cursor:pointer
}

.srr-close-modal:hover,.srr-close-modal:focus{
    color:#000;
    text-decoration:none
}

.srr-modal-input{
    width:100%;
    padding:8px;
    margin-top:4px;
    margin-bottom:12px;
    display:inline-block;
    border:1px solid #ccc;
    border-radius:4px;
    box-sizing:border-box
}
.srr-modal-content h3{
    margin-top:0;
    margin-bottom:15px;
    color:#333
}
.srr-feedback-message{
    padding:10px 15px;
    margin-top:10px;
    border-radius:5px;
    text-align:center;
    font-weight:500;
    box-shadow:0 2px 5px rgba(0,0,0,.15);
    display:none
}
.srr-feedback-message.srr-success,.srr-modal-message.srr-success{
    background-color:#d4edda;
    color:#155724;
    border:1px solid #c3e6cb
}
.srr-feedback-message.srr-error,.srr-modal-message.srr-error{
    background-color:#f8d7da;
    color:#721c24;
    border:1px solid #f5c6cb
}
.srr-feedback-message.srr-message-info{
    background-color:#cfe2ff;
    color:#052c65;
    border:1px solid #9ec5fe
}
.srr-modal-button-secondary{
    background-color:#6c757d;
    color:#fff;
    border-color:#6c757d;
    margin-right:10px
}
.srr-modal-button-secondary:hover{
    background-color:#5a6268;
    border-color:#545b62
}
.srr-modal-buttons{
    text-align:center;
    margin-top:20px
}

/* Responsive Adjustments */
@media (max-width: 576px) {
    .srr-report-container {
        padding: 10px;
    }
    .srr-road-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
    }
    .srr-road-item-actions {
        order: 3;
        margin-top: 10px;
        margin-right: 0;
        width: 100%;
        display: flex;
        justify-content: space-between;
        gap: 5px;
    }
    .srr-road-item-actions .srr-action-button {
        flex-grow: 1;
        margin: 0;
        padding: 8px 5px;
        font-size: 0.85em;
        text-align: center;
    }
    .srr-road-item-content {
        flex-basis: 100%;
    }
    .srr-road-item-meta {
        order: 2;
        text-align: right; 
        flex-grow: 1; 
        font-size: 0.9em;
    }
    .srr-nav-buttons-container.srr-quick-update-nav {
        flex-direction: column;
        align-items: flex-start;
    }
    .srr-nav-buttons-container.srr-quick-update-nav .srr-nav-button {
        padding: 5px 0;
        margin: 0;
    }

    /* Quick Update Composer Buttons on Mobile */
    .srr-quick-update-actions {
        flex-direction: column; 
        gap: 8px; /* Space between stacked buttons */
        align-items: stretch;
    }
    .srr-quick-update-actions .srr-action-button {
        width: 100%;
        margin: 0 !important; 
    }
    .srr-quick-update-actions .srr-nav-buttons-container.srr-quick-update-nav {
        flex-direction: row; 
        justify-content: space-around; 
        margin: 0; /* Remove right margin */
        width: 100%;
    }
    .srr-quick-update-actions .srr-nav-buttons-container.srr-quick-update-nav .srr-nav-button {
        flex-grow: 1; 
        margin: 0 2px;
        text-align: center;
    }
    
    /* Main Action Footer Buttons on mobile */
    .srr-main-actions-footer {
        flex-direction: column; 
        gap: 10px; 
    }
    .srr-main-actions-footer .srr-action-button {
        width: 100%; 
        min-width: 0; 
        flex-basis: auto; 
        margin: 0 !important; 
    }
}