/* =============================================================================
   LOGITERA DOCUMENT CARD MANAGER - Logitera Platform Standards
   Kuzikali Agent - Belge Yonetimi Kutuphonesi
   Prefix: ldcm- (Logitera Document Card Manager)
   ============================================================================= */

/* ===== CONTAINER ===== */
.ldcm-container {
    padding: 20px;
}

/* ===== HEADER ===== */
.ldcm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #4a4a50;
}

.ldcm-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ldcm-header h2 i {
    color: #797bf2;
}

.ldcm-header-stats {
    display: flex;
    gap: 16px;
}

.ldcm-stat-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.ldcm-stat-badge.uploaded {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.ldcm-stat-badge.missing {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.ldcm-stat-badge i {
    font-size: 0.75rem;
}

/* ===== DOCUMENT CARDS GRID ===== */
.ldcm-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* ===== DOCUMENT CARD ===== */
.ldcm-card {
    background: #3b3b40;
    border: 1px solid #4a4a50;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ldcm-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.ldcm-card.has-file {
    border-left: 4px solid #10b981;
}

.ldcm-card.no-file {
    border-left: 4px solid #ef4444;
}

/* Card Header */
.ldcm-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(50, 50, 55, 0.8);
    border-bottom: 1px solid #4a4a50;
}

.ldcm-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ldcm-card-title i {
    font-size: 1.25rem;
    color: #797bf2;
}

.ldcm-card-title span {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.ldcm-card-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ldcm-card-status.uploaded {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.ldcm-card-status.missing {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Card Body */
.ldcm-card-body {
    padding: 16px;
}

/* ===== FILE PREVIEW (Single File) ===== */
.ldcm-file-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(30, 30, 36, 0.5);
    border-radius: 8px;
    margin-bottom: 12px;
}

.ldcm-file-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(121, 123, 242, 0.1);
    border-radius: 8px;
    flex-shrink: 0;
}

.ldcm-file-icon i {
    font-size: 1.5rem;
    color: #797bf2;
}

/* Dosya turu renkli ikonlar */
.ldcm-file-icon i.fa-file-pdf { color: #e74c3c; }
.ldcm-file-icon i.fa-file-word { color: #2b579a; }
.ldcm-file-icon i.fa-file-excel { color: #217346; }
.ldcm-file-icon i.fa-file-powerpoint { color: #d24726; }
.ldcm-file-icon i.fa-file-image { color: #9b59b6; }
.ldcm-file-icon i.fa-file-archive { color: #f39c12; }

.ldcm-file-icon.image {
    background: transparent;
    padding: 0;
}

.ldcm-file-info {
    flex: 1;
    min-width: 0;
}

.ldcm-file-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.ldcm-file-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: #9ca3af;
}

.ldcm-file-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== FILE ACTIONS ===== */
.ldcm-file-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.ldcm-file-actions .ldcm-btn {
    padding: 6px 8px;
}

/* ===== FILE LIST (Multiple Files) ===== */
.ldcm-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.ldcm-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(30, 30, 36, 0.5);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.ldcm-file-item:hover {
    background: rgba(30, 30, 36, 0.8);
}

.ldcm-file-item .ldcm-file-icon {
    width: 36px;
    height: 36px;
}

.ldcm-file-item .ldcm-file-icon i {
    font-size: 1.1rem;
}

.ldcm-file-item .ldcm-file-info {
    flex: 1;
    min-width: 0;
}

.ldcm-file-item .ldcm-file-name {
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.ldcm-file-item .ldcm-file-meta {
    font-size: 0.7rem;
}

/* ===== UPLOAD AREA ===== */
.ldcm-upload-area {
    border: 2px dashed #4a4a50;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ldcm-upload-area:hover {
    border-color: #797bf2;
    background: rgba(121, 123, 242, 0.05);
}

.ldcm-upload-area.drag-over {
    border-color: #797bf2;
    background: rgba(121, 123, 242, 0.1);
}

.ldcm-upload-area i {
    font-size: 2rem;
    color: #797bf2;
    margin-bottom: 8px;
    display: block;
    transition: transform 0.3s ease;
}

.ldcm-upload-area:hover i {
    transform: translateY(-3px);
}

.ldcm-upload-area p {
    margin: 0;
    font-size: 0.85rem;
    color: #9ca3af;
}

.ldcm-upload-area .ldcm-upload-hint {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 4px;
}

/* Compact Upload Area */
.ldcm-upload-area.ldcm-upload-compact {
    padding: 12px;
    border-style: dashed;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ldcm-upload-area.ldcm-upload-compact i {
    font-size: 1rem;
    margin-bottom: 0;
}

.ldcm-upload-area.ldcm-upload-compact p {
    font-size: 0.8rem;
    margin: 0;
}

/* ===== BUTTONS ===== */
.ldcm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.ldcm-btn-primary {
    background: #797bf2;
    color: #fff;
}

.ldcm-btn-primary:hover {
    background: #6366f1;
}

.ldcm-btn-secondary {
    background: rgba(30, 30, 36, 0.8);
    border: 1px solid #4a4a50;
    color: #fff;
}

.ldcm-btn-secondary:hover {
    background: #4a4a50;
}

.ldcm-btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.ldcm-btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

.ldcm-btn-success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.ldcm-btn-success:hover {
    background: rgba(16, 185, 129, 0.3);
}

.ldcm-btn-block {
    width: 100%;
}

/* ===== PROGRESS BAR ===== */
.ldcm-progress {
    margin-top: 12px;
}

.ldcm-progress-bar {
    height: 6px;
    background: #4a4a50;
    border-radius: 3px;
    overflow: hidden;
}

.ldcm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #797bf2, #6366f1);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.ldcm-progress-text {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 4px;
    text-align: center;
}

/* ===== IMAGE THUMBNAIL ===== */
.ldcm-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

/* ===== EMPTY STATE ===== */
.ldcm-empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #3b3b40;
    border: 1px solid #4a4a50;
    border-radius: 12px;
}

.ldcm-empty-state i {
    font-size: 3rem;
    color: #4a4a50;
    margin-bottom: 16px;
}

.ldcm-empty-state p {
    margin: 0;
    font-size: 0.9rem;
    color: #9ca3af;
}

/* ===== LOADING STATE ===== */
.ldcm-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.ldcm-loading i {
    font-size: 2rem;
    color: #797bf2;
    animation: ldcm-spin 1s linear infinite;
}

@keyframes ldcm-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .ldcm-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }

    .ldcm-external-files {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ldcm-cards-grid {
        grid-template-columns: 1fr;
    }

    .ldcm-external-files {
        grid-template-columns: repeat(2, 1fr);
    }

    .ldcm-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .ldcm-header-stats {
        width: 100%;
        justify-content: flex-start;
    }

    .ldcm-file-preview {
        flex-direction: column;
        text-align: center;
    }

    .ldcm-file-info {
        width: 100%;
    }

    .ldcm-file-name {
        text-align: center;
    }

    .ldcm-file-meta {
        justify-content: center;
    }

    .ldcm-file-actions {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .ldcm-container {
        padding: 12px;
    }

    .ldcm-external-files {
        grid-template-columns: repeat(2, 1fr);
    }

    .ldcm-card-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .ldcm-card-status {
        align-self: flex-start;
    }

    .ldcm-upload-area {
        padding: 16px;
    }

    .ldcm-upload-area i {
        font-size: 1.5rem;
    }
}

/* ===== EXTERNAL MODULE SECTION (Read-Only) ===== */
.ldcm-external-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px dashed #4a4a50;
}

.ldcm-header-external {
    background: rgba(100, 100, 110, 0.2);
    border-left: 3px solid #6c757d;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.ldcm-header-external h2 {
    color: #9ca3af;
    font-size: 1rem;
}

.ldcm-header-external h2 i {
    color: #6c757d;
}

.ldcm-readonly-badge {
    background: rgba(108, 117, 125, 0.3);
    color: #9ca3af;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ldcm-file-readonly {
    opacity: 0.85;
    background: rgba(60, 60, 65, 0.5);
}

.ldcm-file-readonly:hover {
    background: rgba(60, 60, 65, 0.7);
}

.ldcm-file-type-badge {
    background: #4a4a50;
    color: #9ca3af;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.ldcm-external-files {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
    background: rgba(30, 30, 36, 0.3);
    border-radius: 8px;
}

/* ===== TYPE GROUP (External Section) ===== */
.ldcm-type-group {
    margin-bottom: 16px;
}

.ldcm-type-group:last-child {
    margin-bottom: 0;
}

.ldcm-type-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 0 4px;
}

.ldcm-type-group-badge {
    background: rgba(121, 123, 242, 0.15);
    color: #797bf2;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(121, 123, 242, 0.3);
}

.ldcm-type-group-count {
    font-size: 0.7rem;
    color: #6b7280;
}

/* ===== IMAGE CLICKABLE ===== */
.ldcm-image-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.ldcm-image-clickable:hover {
    transform: scale(1.05);
    border: 2px solid #797bf2;
    border-radius: 6px;
}

/* ===== IMAGE VIEWER OVERLAY ===== */
.ldcm-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ldcm-viewer-overlay.ldcm-viewer-visible {
    opacity: 1;
}

/* Viewer Toolbar */
.ldcm-viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    position: relative;
    z-index: 2;
}

.ldcm-viewer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 0;
    flex: 1;
}

.ldcm-viewer-title i {
    color: #797bf2;
    flex-shrink: 0;
}

.ldcm-viewer-title span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ldcm-viewer-counter {
    color: #9ca3af;
    font-size: 0.85rem;
    padding: 0 20px;
    flex-shrink: 0;
}

.ldcm-viewer-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.ldcm-viewer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.ldcm-viewer-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.ldcm-viewer-close-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Viewer Navigation Arrows */
.ldcm-viewer-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ldcm-viewer-nav:hover {
    background: rgba(121, 123, 242, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.ldcm-viewer-prev {
    left: 20px;
}

.ldcm-viewer-next {
    right: 20px;
}

/* Viewer Image Container */
.ldcm-viewer-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 80px;
    overflow: hidden;
}

#ldcm-viewer-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    transition: opacity 0.3s ease;
    user-select: none;
    -webkit-user-drag: none;
}

/* Viewer Info Bar */
.ldcm-viewer-info-bar {
    padding: 10px 20px;
    text-align: center;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    position: relative;
    z-index: 2;
}

.ldcm-viewer-info-bar span {
    color: #6b7280;
    font-size: 0.75rem;
}

/* ===== IMAGE VIEWER RESPONSIVE ===== */
@media (max-width: 768px) {
    .ldcm-viewer-toolbar {
        padding: 10px 12px;
    }

    .ldcm-viewer-title {
        font-size: 0.8rem;
    }

    .ldcm-viewer-counter {
        padding: 0 10px;
        font-size: 0.75rem;
    }

    .ldcm-viewer-nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .ldcm-viewer-prev {
        left: 10px;
    }

    .ldcm-viewer-next {
        right: 10px;
    }

    .ldcm-viewer-image-container {
        padding: 10px 60px;
    }

    .ldcm-viewer-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .ldcm-viewer-toolbar {
        padding: 8px 10px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .ldcm-viewer-title {
        font-size: 0.75rem;
        order: 1;
        flex: 1;
    }

    .ldcm-viewer-counter {
        order: 3;
        width: 100%;
        text-align: center;
        padding: 0;
        font-size: 0.7rem;
    }

    .ldcm-viewer-actions {
        order: 2;
    }

    .ldcm-viewer-nav {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .ldcm-viewer-prev {
        left: 5px;
    }

    .ldcm-viewer-next {
        right: 5px;
    }

    .ldcm-viewer-image-container {
        padding: 10px 50px;
    }

    .ldcm-viewer-info-bar {
        display: none;
    }
}

/* ===== SCROLLBAR ===== */
.ldcm-file-list::-webkit-scrollbar {
    width: 6px;
}

.ldcm-file-list::-webkit-scrollbar-track {
    background: #2d2d35;
    border-radius: 3px;
}

.ldcm-file-list::-webkit-scrollbar-thumb {
    background: #4a4a50;
    border-radius: 3px;
}

.ldcm-file-list::-webkit-scrollbar-thumb:hover {
    background: #5a5a60;
}
