/* Frontend Styles for Electricity Plans Plugin */

.electricity-plans-container {
    margin: 30px 0;
    overflow-x: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    background: #fff;
    position: relative; /* For sticky header */
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.electricity-plans-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 15px;
    border: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Add column borders and better visual separation */
.electricity-plans-table th,
.electricity-plans-table td {
    padding: 16px;
    text-align: center;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    border-right: 1px solid #eaeaea;
    vertical-align: middle;
}

.electricity-plans-table th:last-child,
.electricity-plans-table td:last-child {
    border-right: none;
}

.electricity-plans-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.electricity-plans-table tr:hover {
    background-color: #f1f1f1;
    transition: background-color 0.2s ease;
}

/* Alternating column shading for better readability */
.electricity-plans-table td:nth-child(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.electricity-plans-table th {
    background-color: #2c3e50;
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 18px 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 14px;
}

.electricity-plans-table th:first-child {
    border-top-left-radius: 8px;
}

.electricity-plans-table th:last-child {
    border-top-right-radius: 8px;
}

.electricity-plans-table tr:last-child td {
    border-bottom: none;
}

/* Desktop provider cell styling */
.provider-cell {
    width: 120px;
    padding: 12px 16px !important;
    background-color: #fcfcfc !important;
}

.provider-cell img {
    max-width: 100px;
    max-height: 50px;
    display: block;
    margin: 0 auto;
    transition: transform 0.2s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.provider-cell img:hover {
    transform: scale(1.05);
}

/* Price type styling - fixing colors */
span.price-type-cell {
    font-weight: 600;
    border-radius: 6px;
    padding: 8px 12px !important;
    display: inline-block;
    text-align: center;
    min-width: 100px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

span.price-type-cell:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* Fixed styles for specific text content */
span.price-type-cell.Κυμαινόμενο,
span.price-type-cell.κυμαινόμενο {
    background-color: #FFE603 !important;
    color: #000 !important;
}

span.price-type-cell.Σταθερό,
span.price-type-cell.σταθερό {
    background-color: #0032A0 !important;
    color: #fff !important;
}

span.price-type-cell.Ειδικό,
span.price-type-cell.ειδικό {
    background-color: #00AA00 !important;
    color: #fff !important;
}

/* Mobile Responsive Styles - Completely revised card layout */
@media screen and (max-width: 768px) {
    .electricity-plans-container {
        margin: 20px 0;
        padding: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
        border: none;
    }
    
    .electricity-plans-table, 
    .electricity-plans-table tbody,
    .electricity-plans-table tr {
        display: block;
        width: 100%;
    }
    
    /* Hide table headers */
    .electricity-plans-table thead {
        display: none;
    }
    
    /* Style each row as a card */
    .electricity-plans-table tr {
        margin-bottom: 24px;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        background: #fff;
        overflow: hidden;
        border: 1px solid #e0e0e0;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .electricity-plans-table tr:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    }
    
    /* Style each cell as a row in the card */
    .electricity-plans-table td {
        display: flex;
        padding: 14px 16px;
        border: none;
        border-bottom: 1px solid #eaeaea !important;
        background: none !important;
        text-align: left;
        align-items: center;
        justify-content: space-between;
    }
    
    /* Add subtle background to alternate rows for better readability */
    .electricity-plans-table td:nth-child(even) {
        background-color: rgba(0, 0, 0, 0.02) !important;
    }
    
    .electricity-plans-table td:nth-child(odd) {
        background-color: transparent !important;
    }
    
    .electricity-plans-table td:last-child {
        border-bottom: none;
        border-radius: 0 0 12px 12px;
    }
    
    /* Label for each cell */
    .electricity-plans-table td:before {
        content: attr(data-title);
        width: 45%;
        font-weight: 600;
        color: #333;
        padding-right: 10px;
        font-size: 14px;
    }
    
    /* Value for each cell - improved styling */
    .electricity-plans-table td > span {
        width: 55%;
        text-align: center;
        margin-left: auto;
        display: block;
        font-weight: 500;
        color: #444;
        font-size: 15px;
        padding: 4px 0;
    }
    
    /* Numeric values styling */
    td[data-title="ΠΑΓΙΟ (€/ΜΗΝΑ)"] > span,
    td[data-title="ΤΕΛΙΚΗ ΤΙΜΗ (€/KWH)"] > span {
        font-weight: 600;
        color: #0066cc;
        font-size: 18px;
        letter-spacing: 0.3px;
    }
    
    td[data-title="ΔΙΑΡΚΕΙΑ ΣΥΜΒΑΣΗΣ"] > span {
        font-weight: 600;
        color: #0066cc;
        font-size: 18px;
        letter-spacing: 0.3px;
    }
    
    /* Program name styling */
    td[data-title="ΠΡΟΓΡΑΜΜΑ"] > span {
        font-weight: 500;
        color: #333;
        font-size: 15px;
        letter-spacing: 0.2px;
    }
    
    /* Provider cell styling - improved alignment */
    .provider-cell {
        justify-content: center !important;
        padding: 24px 15px !important;
        background-color: #f9f9f9 !important;
        border-bottom: 1px solid #eaeaea !important;
        border-radius: 12px 12px 0 0;
    }
    
    .provider-cell:before {
        display: none;
    }
    
    .provider-cell img {
        max-width: 140px;
        max-height: 60px;
        margin: 0 auto;
        filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
    }
    
    /* Price type cell styling */
    td[data-title="ΕΙΔΟΣ ΤΙΜΟΛΟΓΙΟΥ"] {
        justify-content: space-between;
        padding: 14px 16px !important;
    }
    
    td[data-title="ΕΙΔΟΣ ΤΙΜΟΛΟΓΙΟΥ"] span.price-type-cell {
        width: 55%;
        margin-left: auto;
        text-align: center;
        padding: 8px 12px !important;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 0.5px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 36px;
    }
    
    /* Fixed styles for mobile price types */
    td[data-title="ΕΙΔΟΣ ΤΙΜΟΛΟΓΙΟΥ"] span.price-type-cell.Κυμαινόμενο,
    td[data-title="ΕΙΔΟΣ ΤΙΜΟΛΟΓΙΟΥ"] span.price-type-cell.κυμαινόμενο {
        background-color: #FFE603 !important;
        color: #000 !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    td[data-title="ΕΙΔΟΣ ΤΙΜΟΛΟΓΙΟΥ"] span.price-type-cell.Σταθερό,
    td[data-title="ΕΙΔΟΣ ΤΙΜΟΛΟΓΙΟΥ"] span.price-type-cell.σταθερό {
        background-color: #0032A0 !important;
        color: #fff !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    
    td[data-title="ΕΙΔΟΣ ΤΙΜΟΛΟΓΙΟΥ"] span.price-type-cell.Ειδικό,
    td[data-title="ΕΙΔΟΣ ΤΙΜΟΛΟΓΙΟΥ"] span.price-type-cell.ειδικό {
        background-color: #00AA00 !important;
        color: #fff !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    
    /* Remove hover effect on mobile */
    .electricity-plans-table tr:nth-child(even),
    .electricity-plans-table tr:hover {
        background-color: #fff;
    }
}

/* Extra small devices */
@media screen and (max-width: 480px) {
    .electricity-plans-table tr {
        margin-bottom: 16px;
    }
    
    .electricity-plans-table td {
        padding: 12px 14px;
    }
    
    .electricity-plans-table td:before {
        width: 40%;
        font-size: 13px;
    }
    
    .electricity-plans-table td > span {
        width: 60%;
        font-size: 14px;
    }
    
    td[data-title="ΠΑΓΙΟ (€/ΜΗΝΑ)"] > span,
    td[data-title="ΤΕΛΙΚΗ ΤΙΜΗ (€/KWH)"] > span,
    td[data-title="ΔΙΑΡΚΕΙΑ ΣΥΜΒΑΣΗΣ"] > span {
        font-size: 16px;
    }
    
    td[data-title="ΕΙΔΟΣ ΤΙΜΟΛΟΓΙΟΥ"] span.price-type-cell {
        width: 60%;
        font-size: 13px;
        padding: 6px 10px !important;
    }
    
    .provider-cell img {
        max-width: 120px;
        max-height: 50px;
    }
}

/* Very small devices */
@media screen and (max-width: 380px) {
    .electricity-plans-container {
        margin: 15px 0;
    }
    
    .electricity-plans-table {
        font-size: 13px;
    }
    
    .electricity-plans-table td:before {
        width: 45%;
        font-size: 12px;
    }
    
    .electricity-plans-table td > span {
        width: 55%;
        font-size: 13px;
    }
    
    td[data-title="ΠΑΓΙΟ (€/ΜΗΝΑ)"] > span,
    td[data-title="ΤΕΛΙΚΗ ΤΙΜΗ (€/KWH)"] > span,
    td[data-title="ΔΙΑΡΚΕΙΑ ΣΥΜΒΑΣΗΣ"] > span {
        font-size: 15px;
    }
    
    .provider-cell {
        padding: 15px 10px !important;
    }
    
    .provider-cell img {
        max-width: 100px;
        max-height: 45px;
    }
}

/* Total cost column styling */
.plan-total-cost span {
    font-weight: 700;
    color: #0066cc;
    font-size: 18px;
}

/* Highlight the row with the lowest total cost */
tr.lowest-cost {
    background-color: rgba(0, 170, 0, 0.05) !important;
}

tr.lowest-cost:hover {
    background-color: rgba(0, 170, 0, 0.1) !important;
}

/* Mobile styling for total cost */
@media screen and (max-width: 768px) {
    td[data-title="ΣΥΝΟΛΙΚΟ ΚΟΣΤΟΣ"] > span {
        font-weight: 700;
        color: #0066cc;
        font-size: 20px;
    }
}

/* End of CSS */

