/**
 * Product Attachments Styling
 * Admin and Frontend styles for product attachments
 * Color Scheme: Primary Green #29b998, Dark Navy #0c1928, Light Gray #edeeee
 */

/* ========================================
   ADMIN STYLES
   ======================================== */

#product-attachments-wrapper {
    margin-top: 10px;
}

.product-attachments-list {
    margin-bottom: 20px;
}

.no-attachments {
    padding: 10px;
    background-color: #edeeee;
    border-left: 4px solid #29b998;
    color: #0c1928;
    font-style: italic;
}

.product-attachments-table {
    margin-bottom: 15px;
    border-collapse: collapse;
    width: 100%;
}

.product-attachments-table thead th {
    font-weight: 600;
    padding: 12px 10px;
    text-align: left;
    border-bottom: 2px solid #29b998;
    color: #ffffff;
}

.product-attachments-table tbody td {
    padding: 10px;
    border-bottom: 1px solid #edeeee;
    vertical-align: middle;
}

.product-attachments-table tbody tr:hover {
    background-color: #f9f9f9;
}

.col-title {
    width: 20%;
}

.col-filename {
    width: 30%;
}

.col-type {
    width: 20%;
}

.col-show {
    width: 12%;
}

.col-show-center {
    text-align: center;
}

.col-actions {
    width: 10%;
    text-align: center;
}

.attachment-title,
.attachment-type {
    width: 100%;
    border-radius: 3px;
    font-size: 14px;
    color: #0c1928;
}

.attachment-title:focus,
.attachment-type:focus {
    border-color: #29b998;
    box-shadow: 0 0 3px rgba(41, 185, 152, 0.3);
    outline: none;
}

.attachment-file-wrapper {
    display: flex;
    gap: 5px;
    align-items: center;
}

.attachment-file-display {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: #f9f9f9;
    font-size: 13px;
    color: #666;
}

.select-attachment-button {
    white-space: nowrap;
    flex-shrink: 0;
    background-color: #29b998;
    color: #ffffff;
    border: 1px solid #29b998;
}

.select-attachment-button:hover {
    background-color: #219f83;
    border-color: #219f83;
}

.remove-attachment-row {
    color: #dc3545;
    text-decoration: none;
    background: none;
    border: none;
}

.remove-attachment-row:hover {
    color: #c82333;
    background-color: #fff5f5;
}

.update-attachment-row {
    background-color: #29b998;
    color: #ffffff;
    border: 1px solid #29b998;
    margin-right: 5px;
}

.update-attachment-row:hover {
    background-color: #219f83;
    border-color: #219f83;
}

.attachment-actions-cell {
    display: flex;
    gap: 5px;
    align-items: center;
}

.product-attachments-actions {
    padding-top: 10px;
    border-top: 1px solid #ddd;
    margin-top: 15px;
}

.product-attachments-actions button {
    font-size: 14px;
    background-color: #29b998;
    color: #ffffff;
    border: 1px solid #29b998;
}

.product-attachments-actions button:hover {
    background-color: #219f83;
    border-color: #219f83;
}

/* ========================================
   FRONTEND STYLES
   ======================================== */

.product-attachments {
    margin: 40px 0px;
}

.product-attachments-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-attachment-item {
    margin: 0;
}

.attachment-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background-color: #ffffff;
    border: 1px solid #edeeee;
    border-left: 4px solid #29b998;
    border-radius: 3px;
    text-decoration: none;
    color: #0c1928;
    transition: all 0.3s ease;
    gap: 12px;
}

.attachment-link:hover {
    background-color: #f9f9f9;
    border-left-color: #219f83;
    color: #29b998;
    transform: translateX(4px);
    box-shadow: 0 2px 6px rgba(41, 185, 152, 0.15);
}

.attachment-link .attachment-icon {
    font-size: 20px;
    flex-shrink: 0;
    order: 3;
}

.attachment-link .attachment-title {
    font-size: 15px;
    font-weight: 500;
    color: inherit;
    flex: 1;
    order: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.attachment-type-label {
    display: inline-block;
    font-size: 11px;
    background-color: #edeeee;
    color: #0c1928;
    padding: 3px 8px;
    border-radius: 3px;
    white-space: nowrap;
    font-weight: 400;
}

.attachment-link:hover .attachment-type-label {
    background-color: #29b998;
    color: #ffffff;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .product-attachments {
        margin-top: 30px;
        padding-top: 30px;
    }

    .product-attachments h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .attachment-link {
        padding: 12px 15px;
        flex-wrap: wrap;
    }

    .attachment-link .attachment-icon {
        order: 2;
    }

    .attachment-link .attachment-title {
        order: 1;
        flex: 0 0 100%;
        margin-bottom: 8px;
    }

    .attachment-link .attachment-type {
        order: 3;
    }

    /* Admin table adjustments */
    .col-filename {
        width: 25%;
    }

    .col-type {
        width: 20%;
    }

    .col-show {
        width: 15%;
    }

    .col-actions {
        width: 12%;
    }
}

@media (max-width: 600px) {
    .product-attachments-table {
        font-size: 13px;
    }

    .product-attachments-table td,
    .product-attachments-table th {
        padding: 8px 5px;
    }

    .attachment-title,
    .attachment-type {
        font-size: 12px;
    }

    .select-attachment-button {
        padding: 4px 8px;
        font-size: 12px;
    }

    .col-title {
        width: 25%;
    }

    .col-filename {
        width: 28%;
    }

    .col-type {
        width: 18%;
    }

    .col-show {
        width: 12%;
    }

    .col-actions {
        width: 17%;
    }
}
