/* 
 * COMPONENTS.CSS - Component-specific styles for Authorised Parts List
 * 
 * This file contains reusable component styles to avoid duplication.
 */

/* Action Button Styles */
.btn-edit, .btn-delete, .btn-restore {
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    margin: 0 0.125rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-edit {
    color: #9b2c66;
}

.btn-edit:hover {
    background-color: #fde8f2;
    color: #7c1f50;
}

.btn-delete {
    color: #b5386f;
}

.btn-delete:hover {
    background-color: #ffe9f2;
    color: #8e2758;
}

.btn-restore {
    color: #28a745;
}

.btn-restore:hover {
    background-color: #d4edda;
    color: #1e7e34;
}

/* Button Styles */
.btn-pink, .add-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    transition: background-color 0.2s;
}

.btn-pink:hover, .add-btn:hover {
    background-color: var(--primary-hover);
}

.btn-pink.small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Select Styles */
select, .styled-select {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    background-color: #fff;
    font-size: 1rem;
    color: #333;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s ease;
    max-width: 300px;
    margin-bottom: 1rem;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

select:focus, .styled-select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(105, 42, 128, 0.2);
}

/* Form Styles */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: flex-end;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #e6007e;
    box-shadow: 0 0 0 2px rgba(230, 0, 126, 0.2);
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: bold;
    display: none;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    max-width: 300px;
    word-wrap: break-word;
}

.toast.success {
    background-color: #e6007e;
}

.toast.error {
    background-color: #ff4d4d;
}

.file-page h2 {
    margin: 0;
}

.file-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.upload-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

.drop-zone {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.drop-zone.dragging {
    border-color: var(--toolbar-colour);
    background-color: #fff5fb;
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--toolbar-colour);
    margin-bottom: 0.5rem;
}

.browse-btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--toolbar-colour);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    margin: 0.4rem 0;
}

.helper-text {
    margin: 0.2rem 0 0;
    color: #666;
    font-size: 0.9rem;
}

.progress-container {
    margin-top: 1rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.progress-bar {
    background: #f1f1f1;
    border-radius: 8px;
    height: 10px;
    overflow: hidden;
}

.progress-bar div {
    height: 100%;
    width: 0;
    background: var(--toolbar-colour);
    transition: width 0.2s ease;
}

.upload-message {
    margin-top: 0.8rem;
    font-weight: 600;
}

.upload-message.success { color: green; }
.upload-message.error { color: #d4007f; }

/* Modal Styles */
.modal-overlay, .modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999 !important;
}

.modal-overlay.show, .modal.show {
    display: flex !important;
}

.modal-content, .modal-box {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    max-height: min(88vh, 920px);
    overflow: auto;
}

.close-modal, .modal-content .close {
    position: absolute;
    top: 0.75rem;
    right: 1.25rem;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}

/* Event Header */
.event-header,
.event-header-flex {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.event-title {
    font-size: 1.4rem;
    font-weight: bold;
}

.event-dates {
    font-size: 1rem;
    opacity: 0.95;
}

/* Section Headings */
.section-heading {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.file-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 14px 0;
    flex-wrap: wrap;
}

.breadcrumb-link {
    border: 1px solid #d8d8d8;
    background: #fff;
    color: #333;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 14px;
}

.breadcrumb-link:hover {
    background: #f6f6f6;
}

.breadcrumb-sep {
    color: #666;
}