/* ===========================================
   Share Project Modal Styles - Design Padronizado
   =========================================== */

/* Modal Base */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    animation: shareModalFadeIn 0.15s ease;
}

.share-modal.show {
    display: flex;
}

@keyframes shareModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Container */
.share-modal-container {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 6px;
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
    animation: shareModalSlideIn 0.2s ease;
    overflow: hidden;
}

@keyframes shareModalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 42px;
    min-height: 42px;
    padding: 0 16px;
    background: #252525;
    border-bottom: 1px solid #333;
}

.share-modal-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.share-modal-header h2 i {
    color: var(--primary-color);
    font-size: 14px;
}

.share-modal-close {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
    transition: all 0.15s ease;
    padding: 0;
}

.share-modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #aaa;
}

/* Modal Body */
.share-modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    background: #1a1a1a;
}

/* Project Info */
.share-project-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #333;
    border-radius: 4px;
    margin-bottom: 16px;
}

.share-project-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: rgba(52, 152, 219, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 16px;
}

.share-project-details h3 {
    margin: 0 0 2px 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
}

.share-project-details span {
    font-size: 10px;
    color: #666;
}

/* Search Section */
.share-search-section {
    margin-bottom: 16px;
}

.share-search-section label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.share-search-wrapper {
    position: relative;
}

.share-search-wrapper i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    font-size: 11px;
}

.share-search-input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-light);
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.share-search-input:focus {
    border-color: var(--primary-color);
}

.share-search-input:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.share-search-input::placeholder {
    color: #555;
}

/* Search Results Dropdown */
.share-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #252525;
    border: 1px solid #333;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.share-search-results.show {
    display: block;
}

.share-search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.share-search-result:hover {
    background: rgba(255, 255, 255, 0.05);
}

.share-search-result:first-child {
    border-radius: 4px 4px 0 0;
}

.share-search-result:last-child {
    border-radius: 0 0 4px 4px;
}

.share-search-result:only-child {
    border-radius: 4px;
}

.share-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 11px;
    flex-shrink: 0;
}

.share-user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.share-user-info {
    flex: 1;
    min-width: 0;
}

.share-user-name {
    font-weight: 500;
    color: var(--text-light);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-user-email {
    font-size: 10px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-search-empty {
    padding: 16px;
    text-align: center;
    color: #666;
    font-size: 11px;
}

.share-search-empty i {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
    color: #444;
}

/* Permission Select */
.share-permission-select {
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-light);
    cursor: pointer;
    min-width: 100px;
}

.share-permission-select:focus {
    border-color: var(--primary-color);
}

.share-permission-select:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Current Shares Section */
.share-current-section {
    margin-top: 16px;
}

.share-current-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.share-current-header h4 {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.share-count-badge {
    background: rgba(52, 152, 219, 0.15);
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
}

/* Shares List */
.share-list {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
}

.share-list-empty {
    padding: 24px 16px;
    text-align: center;
    color: #666;
}

.share-list-empty i {
    font-size: 28px;
    color: #444;
    margin-bottom: 10px;
    display: block;
    opacity: 0.5;
}

.share-list-empty p {
    margin: 0 0 4px 0;
    font-weight: 500;
    font-size: 12px;
    color: #888;
}

.share-list-empty span {
    font-size: 10px;
    color: #666;
}

/* Share Item */
.share-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #333;
    transition: background 0.15s ease;
}

.share-item:last-child {
    border-bottom: none;
}

.share-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.share-item-info {
    flex: 1;
    min-width: 0;
}

.share-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.share-item-remove {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.15s ease;
    font-size: 12px;
}

.share-item-remove:hover {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

/* Permission Badge */
.share-permission-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

.share-permission-badge.view {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
}

.share-permission-badge.edit {
    background: rgba(243, 156, 18, 0.15);
    color: #f39c12;
}

.share-permission-badge.admin {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

/* Owner Badge */
.share-owner-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

/* Add Share Form */
.share-add-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.share-add-btn {
    padding: 6px 14px;
    background: rgba(52, 152, 219, 0.15);
    color: var(--primary-color);
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.share-add-btn:hover {
    background: rgba(52, 152, 219, 0.25);
}

.share-add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Footer */
.share-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #1e1e1e;
    border-top: 1px solid #333;
}

.share-link-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-copy-link-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 4px;
    font-size: 11px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.share-copy-link-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.share-done-btn {
    padding: 6px 14px;
    background: rgba(52, 152, 219, 0.15);
    color: var(--primary-color);
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.share-done-btn:hover {
    background: rgba(52, 152, 219, 0.25);
}

/* Loading State */
.share-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    color: #666;
    font-size: 11px;
}

.share-loading i {
    animation: shareSpin 0.8s linear infinite;
    margin-right: 8px;
    color: var(--primary-color);
}

@keyframes shareSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Toast notifications for share actions */
.share-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #252525;
    border: 1px solid #333;
    color: var(--text-light);
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 10001;
    opacity: 0;
    transition: all 0.2s ease;
}

.share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.share-toast.success i {
    color: #2ecc71;
}

.share-toast.error i {
    color: #e74c3c;
}

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

    .share-modal-header {
        padding: 0 12px;
    }

    .share-modal-body {
        padding: 12px;
    }

    .share-item {
        flex-wrap: wrap;
    }

    .share-item-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #333;
    }

    .share-modal-footer {
        flex-direction: column;
        gap: 10px;
    }

    .share-done-btn {
        width: 100%;
        justify-content: center;
    }
}
