/* Diamond Search Pro - Main Stylesheet */

/* Layout Styles */
.dsp-app {
    width: 100%;
    box-sizing: border-box;
}

/* Side-by-side layout for desktop */
.dsp-layout-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.dsp-filters {
    flex: 0 0 280px;
}

.dsp-main {
    flex: 1;
    min-width: 0; /* Fix for flex items with long content */
}

/* Mobile styles */
.dsp-mobile-filter-toggle {
    display: none;
    margin-bottom: 15px;
}

.dsp-toggle-filters {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    justify-content: center;
}

.dsp-filter-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='21' x2='4' y2='14'%3E%3C/line%3E%3Cline x1='4' y1='10' x2='4' y2='3'%3E%3C/line%3E%3Cline x1='12' y1='21' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='8' x2='12' y2='3'%3E%3C/line%3E%3Cline x1='20' y1='21' x2='20' y2='16'%3E%3C/line%3E%3Cline x1='20' y1='12' x2='20' y2='3'%3E%3C/line%3E%3Cline x1='1' y1='14' x2='7' y2='14'%3E%3C/line%3E%3Cline x1='9' y1='8' x2='15' y2='8'%3E%3C/line%3E%3Cline x1='17' y1='16' x2='23' y2='16'%3E%3C/line%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.dsp-close-filters {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 30px;
    text-align: center;
    background: #fff;
    border-radius: 50%;
    border: 1px solid #ddd;
    cursor: pointer;
    z-index: 1;
}

/* Accordion styles */
.dsp-filter-accordion .dsp-filter-header {
    cursor: pointer;
    position: relative;
    padding: 10px 15px;
    margin: 0;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dsp-filter-accordion .dsp-accordion-icon {
    font-size: 18px;
    font-weight: bold;
    color: #777;
}

.dsp-filter-accordion .dsp-filter-content {
    display: none;
    padding: 15px;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    background-color: #fff;
}

.dsp-filter-accordion.dsp-accordion-open .dsp-filter-header {
    border-radius: 4px 4px 0 0;
}

.dsp-filter-accordion.dsp-accordion-open .dsp-filter-content {
    display: block;
}

.dsp-mobile-accordion .dsp-filter-accordion {
    margin-bottom: 10px;
}

/* Master Accordion Style */
.dsp-master-accordion > .dsp-filter-header {
    background-color: #2271b1;
    color: white;
    border-color: #135e96;
}

.dsp-master-accordion > .dsp-filter-header .dsp-accordion-icon {
    color: white;
}

.dsp-master-accordion > .dsp-filter-content {
    padding: 20px;
    border-color: #135e96;
}

/* Shape Grid Styles */
.dsp-shape-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
}

@media (max-width: 768px) {
    .dsp-shape-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    .dsp-mobile-filter-toggle {
        display: block;
    }
    
    .dsp-layout-wrapper {
        display: block;
    }
    
    .dsp-filters {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        background: white;
        padding: 20px;
        overflow-y: auto;
        box-shadow: 0 0 10px rgba(0,0,0,0.1);
    }
    
    .dsp-filters-open {
        display: block;
    }
    
    .dsp-close-filters {
        display: block;
    }
    
    body.dsp-filters-modal-open {
        overflow: hidden;
    }
}

/* Filter Container Styles */
.dsp-filter {
    margin-bottom: 30px;
}

.dsp-filter h3 {
    font-size: 16px;
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

/* Shape Filter Styles */
.dsp-shape-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
}

.dsp-shape-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 5px;
    transition: all 0.2s;
}

.dsp-shape-option:hover {
    border-color: #2271b1;
}

.dsp-shape-option input {
    display: none;
}

.dsp-shape-option.dsp-selected {
    border-color: #2271b1;
    background-color: #f0f7fc;
}

.dsp-shape-icon {
    width: 40px;
    height: 40px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    margin-bottom: 5px;
}

/* Use actual PNG images for diamond shapes */
.dsp-shape-round {
    background-image: url('../images/shapes/round.png');
}

.dsp-shape-princess {
    background-image: url('../images/shapes/princess.png');
}

.dsp-shape-cushion {
    background-image: url('../images/shapes/cushion.png');
}

.dsp-shape-emerald {
    background-image: url('../images/shapes/emerald.png');
}

.dsp-shape-oval {
    background-image: url('../images/shapes/oval.png');
}

.dsp-shape-radiant {
    background-image: url('../images/shapes/radiant.png');
}

.dsp-shape-asscher {
    background-image: url('../images/shapes/asscher.png');
}

.dsp-shape-marquise {
    background-image: url('../images/shapes/marquise.png');
}

.dsp-shape-heart {
    background-image: url('../images/shapes/heart.png');
}

.dsp-shape-pear {
    background-image: url('../images/shapes/pear.png');
}

.dsp-shape-trillion {
    background-image: url('../images/shapes/trillion.png');
}

.dsp-shape-old-mine {
    background-image: url('../images/shapes/old-mine.png');
}

.dsp-shape-old-european {
    background-image: url('../images/shapes/old-european.png');
}

.dsp-shape-label {
    font-size: 12px;
    text-align: center;
}

.dsp-shape-nav {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dsp-shape-nav:hover {
    background: #f5f5f5;
}

/* Range Slider Styles */
.dsp-slider-container {
    margin: 15px 0;
}

.dsp-range-inputs {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.dsp-range-prefix {
    margin-right: 5px;
    color: #666;
}

.dsp-range-inputs input {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.dsp-range-separator {
    margin: 0 10px;
    color: #666;
}

/* Checkbox Filter Styles */
.dsp-checkbox-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dsp-checkbox-option {
    flex: 0 0 calc(33.333% - 7px);
    display: flex;
    align-items: center;
}

.dsp-checkbox-option input {
    margin-right: 8px;
}

/* Results Container Styles */
.dsp-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.dsp-list-view {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dsp-list-view .dsp-diamond {
    display: flex;
    border: 1px solid #eee;
    border-radius: 4px;
}

.dsp-list-view .dsp-diamond-image {
    flex: 0 0 150px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
}

.dsp-list-view .dsp-diamond-image img {
    max-width: 120px;
    max-height: 120px;
}

.dsp-list-view .dsp-diamond-info {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.dsp-list-view .dsp-diamond-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.dsp-list-view .dsp-diamond-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.dsp-list-view .dsp-detail-item {
    flex: 0 0 calc(33.333% - 14px);
}

.dsp-list-view .dsp-diamond-bottom {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dsp-list-view .dsp-diamond-price {
    font-size: 18px;
    font-weight: 700;
    color: #2271b1;
}

.dsp-list-view .dsp-diamond-actions {
    display: flex;
    gap: 10px;
}

/* Diamond Card Styles */
.dsp-diamond {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.2s;
}

.dsp-diamond:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.dsp-diamond-image {
    position: relative;
    padding-top: 75%;
    background: #fafafa;
    overflow: hidden;
}

.dsp-diamond-image img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.dsp-diamond-info {
    padding: 15px;
}

.dsp-diamond-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px;
    color: #333;
}

.dsp-diamond-detail {
    margin-bottom: 3px;
    font-size: 14px;
    color: #666;
}

.dsp-detail-label {
    font-weight: 500;
    margin-right: 5px;
}

.dsp-diamond-price {
    font-size: 18px;
    font-weight: 700;
    color: #2271b1;
    margin: 10px 0;
}

.dsp-diamond-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.dsp-view-details {
    display: inline-block;
    padding: 8px 12px;
    background: #2271b1;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.2s;
}

.dsp-view-details:hover {
    background: #135e96;
    text-decoration: none;
    color: white;
}

.dsp-compare-check-container {
    display: flex;
    align-items: center;
}

.dsp-compare-check-container label {
    font-size: 14px;
    margin-left: 5px;
    cursor: pointer;
}

/* View Toggle */
.dsp-view-toggle {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.dsp-view-toggle button {
    flex: 1;
    padding: 8px 12px;
    background: #f9f9f9;
    border: none;
    cursor: pointer;
}

.dsp-view-toggle button:hover {
    background: #f5f5f5;
}

.dsp-view-toggle button.active {
    background: #2271b1;
    color: white;
}

/* Header and Results Count */
.dsp-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dsp-results-count {
    font-size: 16px;
    color: #555;
}

.dsp-sort-options {
    display: flex;
    align-items: center;
}

.dsp-sort-label {
    margin-right: 10px;
    color: #555;
}

.dsp-sort-select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Pagination Styles */
.dsp-pagination {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.dsp-pagination-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 5px;
}

.dsp-pagination-item a {
    display: block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #555;
    text-decoration: none;
}

.dsp-pagination-item a:hover {
    background: #f5f5f5;
}

.dsp-pagination-item.active a {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
}

/* Compare Bar Styles */
.dsp-compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.dsp-compare-bar.dsp-active {
    transform: translateY(0);
}

.dsp-compare-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

.dsp-compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.dsp-compare-count {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.dsp-compare-clear {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    text-decoration: underline;
}

.dsp-compare-items {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.dsp-compare-item {
    flex: 0 0 120px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.dsp-compare-item-image {
    position: relative;
    height: 100px;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dsp-compare-item-image img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.dsp-compare-item-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.dsp-compare-item-info {
    padding: 8px;
    text-align: center;
}

.dsp-compare-item-carat {
    font-size: 14px;
    color: #666;
}

.dsp-compare-item-price {
    font-weight: 600;
    color: #2271b1;
    margin-top: 5px;
}

.dsp-compare-empty {
    background: #f9f9f9;
    border: 1px dashed #ddd;
}

.dsp-compare-item-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #aaa;
    font-size: 24px;
}

.dsp-compare-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.dsp-compare-button, .dsp-compare-share {
    padding: 10px 15px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.dsp-compare-share {
    background: #555;
}

.dsp-compare-button:hover {
    background: #135e96;
}

.dsp-compare-share:hover {
    background: #444;
}

.dsp-diamond-compare-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    z-index: 2;
}

.dsp-diamond-compare-label input {
    margin-right: 5px;
}

.dsp-diamond.dsp-selected {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

/* Flash animation for compare bar */
@keyframes flash {
    0%, 100% { border-top-color: #ddd; }
    50% { border-top-color: #2271b1; }
}

.dsp-compare-bar.dsp-flash {
    animation: flash 0.5s 3;
}

/* Compare Table Styles */
.dsp-compare-table-container {
    overflow-x: auto;
    margin-bottom: 30px;
}

.dsp-compare-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
}

.dsp-compare-table th, .dsp-compare-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #ddd;
}

.dsp-compare-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.dsp-compare-table td.dsp-compare-attribute {
    text-align: left;
    font-weight: 600;
    background: #f9f9f9;
}

.dsp-compare-diamond-header {
    min-width: 180px;
    vertical-align: top;
}

.dsp-compare-diamond-image {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.dsp-compare-diamond-image img {
    max-width: 100px;
    max-height: 100px;
}

.dsp-compare-diamond-price {
    color: #2271b1;
    font-weight: 700;
    margin: 10px 0;
}

.dsp-compare-table .dsp-view-details {
    display: inline-block;
    padding: 6px 10px;
    margin-top: 5px;
    font-size: 13px;
}

/* Media Queries for Mobile */
@media (max-width: 768px) {
    .dsp-checkbox-option {
        flex: 0 0 calc(50% - 5px);
    }
    
    .dsp-list-view .dsp-diamond {
        flex-direction: column;
    }
    
    .dsp-list-view .dsp-diamond-image {
        flex: 0 0 auto;
        padding-top: 75%;
    }
    
    .dsp-list-view .dsp-diamond-detail {
        flex: 0 0 100%;
    }
    
    .dsp-list-view .dsp-diamond-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .dsp-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .dsp-grid-view {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .dsp-compare-items {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 15px;
    }
    
    .dsp-compare-bar.dsp-active {
        max-height: 70vh;
        overflow-y: auto;
    }
}