/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 13, 14, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: #ffffff;
    border-radius: 5px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow-y: scroll;
    box-shadow: 0 20px 60px rgba(12, 13, 14, 0.2);
}

.modal-overlay.active .modal-container {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid rgba(12, 13, 14, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 400;
    letter-spacing: -0.5px;
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.6;
}

.modal-close:hover {
    opacity: 1;
    background: rgba(12, 13, 14, 0.05);
}

.modal-close svg {
    width: 20px;
    height: 20px;
    stroke: #0c0d0e;
}

.modal-content {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.search-container {
    position: relative;
    margin-bottom: 24px;
}

.search-input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: 1px solid rgba(12, 13, 14, 0.2);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s;
    background: #ffffff;
    color: #0c0d0e;
}

.search-input:focus {
    outline: none;
    border-color: rgba(12, 13, 14, 0.6);
    box-shadow: 0 0 0 3px rgba(12, 13, 14, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    opacity: 0.4;
}

.search-icon svg {
    width: 100%;
    height: 100%;
    stroke: #0c0d0e;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.item-card {
    padding: 16px;
    border: 1px solid rgba(12, 13, 14, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: #ffffff;
    opacity: 0;
    transform: translateY(10px);
}

.item-card:hover {
    border-color: rgba(12, 13, 14, 0.3);
    background: #f8f8f8;
    transform: translateY(-2px);
}

.item-card.selected {
    border-color: #0c0d0e;
    background: #0c0d0e;
    color: #ffffff;
}

.item-code {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 4px;
}

.item-card.selected .item-code {
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
}

.item-name {
    font-size: 16px;
    line-height: 1.4;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.6;
    font-size: 16px;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #f0f0f0;
    border-top-color: #0c0d0e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.toast {
    background: #0c0d0e;
    color: #ffffff;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(12, 13, 14, 0.2);
    transform: translateX(100%);
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.toast:hover {
    transform: translateX(0) scale(1.02);
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 14px;
}

.toast-message {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.4;
}

.toast.success {
    background: #10b981;
}

.toast.error {
    background: #ef4444;
}

.toast.warning {
    background: #f59e0b;
}

.toast.info {
    background: #3b82f6;
}

/* University dropdown */
.university-dropdown {
    position: relative;
}

.dropdown-select {
    width: 100%;
    padding: 16px 0;
    border: none;
    border-bottom: 1px solid rgba(12, 13, 14, 0.2);
    font-size: 16px;
    font-family: inherit;
    color: #0c0d0e;
    background: transparent;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.3s;
}

.dropdown-select:focus {
    outline: none;
    border-bottom-color: rgba(12, 13, 14, 0.6);
}

.dropdown-arrow {
    position: absolute;
    right: 0;
    bottom: 16px;
    width: 20px;
    height: 20px;
    opacity: 0.4;
    pointer-events: none;
}

.dropdown-arrow svg {
    width: 100%;
    height: 100%;
    stroke: #0c0d0e;
}

/* Responsive */
@media (max-width: 767px) {
    .modal-container {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 20px 24px;
    }

    .modal-content {
        padding: 24px;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }

    .toast-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}