/* GSM Download Manager - Frontend Styles */

.gsm-dm-wrapper {
    font-family: inherit;
    max-width: 1100px;
}

/* Breadcrumb */
.gsm-dm-breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
    color: #555;
}
.gsm-dm-breadcrumb a {
    color: #0073aa;
    text-decoration: none;
}
.gsm-dm-breadcrumb a:hover { text-decoration: underline; }
.gsm-dm-breadcrumb span { margin: 0 6px; color: #999; }

/* Folders Grid */
.gsm-dm-folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.gsm-dm-folder-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.gsm-dm-folder-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
    border-color: #0073aa;
    color: inherit;
    text-decoration: none;
}

.gsm-dm-folder-thumb img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

.gsm-dm-folder-icon {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f2ff 100%);
    color: #0073aa;
}
.gsm-dm-folder-icon svg {
    width: 48px;
    height: 48px;
}

.gsm-dm-folder-info {
    padding: 12px;
}
.gsm-dm-folder-info h3 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.3;
}
.gsm-dm-folder-info p {
    margin: 0 0 8px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}
.gsm-dm-file-count {
    font-size: 11px;
    color: #0073aa;
    background: #e6f2ff;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Files Section */
.gsm-dm-files-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.gsm-dm-files-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gsm-dm-file-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.gsm-dm-file-item:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0,115,170,0.1);
}

.gsm-dm-file-thumb img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.gsm-dm-file-info { flex: 1; }
.gsm-dm-file-info h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}
.gsm-dm-file-info p {
    margin: 0 0 6px;
    font-size: 12px;
    color: #666;
}

.gsm-dm-file-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.gsm-dm-size, .gsm-dm-downloads {
    font-size: 12px;
    color: #777;
}

.gsm-dm-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
}
.gsm-dm-badge.free {
    background: #d4edda;
    color: #155724;
}
.gsm-dm-badge.paid {
    background: #fff3cd;
    color: #856404;
}

/* Download Buttons */
.gsm-dm-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    white-space: nowrap;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
    text-align: center;
}
.gsm-dm-btn:active { transform: scale(0.97); }

.gsm-dm-btn-free {
    background: #00a32a;
    color: #fff;
}
.gsm-dm-btn-free:hover { background: #008a22; color: #fff; }

.gsm-dm-btn-paid {
    background: #0073aa;
    color: #fff;
}
.gsm-dm-btn-paid:hover { background: #005d8c; color: #fff; }

.gsm-dm-btn-redownload {
    background: #6c757d;
    color: #fff;
}
.gsm-dm-btn-redownload:hover { background: #545b62; color: #fff; }

.gsm-dm-btn-login {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}
.gsm-dm-btn-login:hover { background: #e0e0e0; color: #333; }

.gsm-dm-file-action { flex-shrink: 0; }

/* Empty state */
.gsm-dm-empty {
    text-align: center;
    color: #888;
    padding: 40px;
    background: #fafafa;
    border: 1px dashed #ddd;
    border-radius: 8px;
}

/* Modal */
#gsm-dm-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gsm-dm-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
}
.gsm-dm-modal-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 32px 40px;
    min-width: 300px;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.gsm-dm-modal-content p { margin: 12px 0 0; font-size: 15px; color: #333; }

/* Spinner */
.gsm-dm-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: gsm-spin 0.7s linear infinite;
    margin: 0 auto;
}
@keyframes gsm-spin { to { transform: rotate(360deg); } }

#gsm-dm-modal-error p {
    font-size: 14px;
    color: #cc0000;
    margin-bottom: 16px;
}
.gsm-dm-btn-topup {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    padding: 9px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-right: 8px;
}
.gsm-dm-btn-topup:hover { background: #005d8c; color: #fff; }
.gsm-dm-modal-close {
    background: #f0f0f0;
    border: 1px solid #ccc;
    padding: 9px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.gsm-dm-modal-close:hover { background: #e0e0e0; }

/* Responsive */
@media (max-width: 600px) {
    .gsm-dm-folders-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .gsm-dm-file-item {
        flex-wrap: wrap;
    }
    .gsm-dm-file-action {
        width: 100%;
        text-align: right;
    }
}
