/* ============================================
   Template Pengurusan MAT - Styles
   ============================================ */

/* Page intro */
.template-intro {
    text-align: center;
    margin-bottom: 30px;
    padding: 0 10px;
}

.template-intro p {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 16px;
}

.template-intro .gdrive-main-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #4285f4, #1a73e8);
    color: white;
    padding: 10px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
}

.template-intro .gdrive-main-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);
}

/* Folder Grid */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 0 5px;
}

/* Folder Card */
.folder-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.folder-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

/* Card Header */
.folder-card-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.folder-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.folder-card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.3;
}

.folder-card-header .folder-count {
    font-size: 12px;
    color: #888;
    font-weight: 500;
    margin-top: 2px;
}

/* Card Body - File List */
.folder-card-body {
    padding: 16px 20px;
    flex: 1;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    margin-bottom: 4px;
}

.file-item:hover {
    background: #f5f8ff;
    transform: translateX(4px);
}

.file-thumb {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.file-thumb.pdf { background: #fce8e8; }
.file-thumb.doc { background: #e3f2fd; }
.file-thumb.xls { background: #e8f5e9; }
.file-thumb.ppt { background: #fff3e0; }
.file-thumb.img { background: #f3e5f5; }
.file-thumb.audio { background: #e8eaf6; }
.file-thumb.video { background: #fce4ec; }
.file-thumb.folder { background: #fff8e1; }
.file-thumb.generic { background: #f5f5f5; }

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

.file-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #333;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 11.5px;
    color: #999;
    margin-top: 2px;
}

.file-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: all 0.2s;
    flex-shrink: 0;
    font-size: 14px;
}

.file-item:hover .file-action {
    background: #e8f0fe;
}

/* Card Footer */
.folder-card-footer {
    padding: 14px 20px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

.folder-card-footer a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4285f4;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}

.folder-card-footer a:hover {
    background: #e8f0fe;
}

/* Color Themes for Cards */
.folder-card[data-theme="notis"] .folder-icon        { background: #e3f2fd; color: #1565c0; }
.folder-card[data-theme="notis"] .folder-card-header  { background: linear-gradient(135deg, #e3f2fd 0%, #f5f9ff 100%); }

.folder-card[data-theme="manual"] .folder-icon        { background: #e8f5e9; color: #2e7d32; }
.folder-card[data-theme="manual"] .folder-card-header  { background: linear-gradient(135deg, #e8f5e9 0%, #f5fdf6 100%); }

.folder-card[data-theme="borang"] .folder-icon        { background: #fff3e0; color: #e65100; }
.folder-card[data-theme="borang"] .folder-card-header  { background: linear-gradient(135deg, #fff3e0 0%, #fffcf5 100%); }

.folder-card[data-theme="laporan"] .folder-icon       { background: #fce4ec; color: #c62828; }
.folder-card[data-theme="laporan"] .folder-card-header { background: linear-gradient(135deg, #fce4ec 0%, #fff5f7 100%); }

.folder-card[data-theme="lagu"] .folder-icon          { background: #e8eaf6; color: #283593; }
.folder-card[data-theme="lagu"] .folder-card-header    { background: linear-gradient(135deg, #e8eaf6 0%, #f5f6fd 100%); }

.folder-card[data-theme="poster"] .folder-icon        { background: #f3e5f5; color: #6a1b9a; }
.folder-card[data-theme="poster"] .folder-card-header  { background: linear-gradient(135deg, #f3e5f5 0%, #faf5fc 100%); }

/* GDrive Embed Section */
.gdrive-embed-section {
    margin-top: 40px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.gdrive-embed-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
}

.gdrive-embed-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gdrive-embed-header a {
    color: #4285f4;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.gdrive-embed-header a:hover {
    text-decoration: underline;
}

.gdrive-embed-body {
    position: relative;
    width: 100%;
    height: 500px;
}

.gdrive-embed-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Loading State */
.template-loading {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.template-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #066e66;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .folder-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .folder-card-header {
        padding: 16px 18px;
    }

    .folder-icon {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }

    .folder-card-body {
        padding: 12px 14px;
    }

    .file-item {
        padding: 8px 10px;
        gap: 10px;
    }

    .file-thumb {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .gdrive-embed-body {
        height: 350px;
    }

    .template-intro .gdrive-main-link {
        font-size: 13px;
        padding: 8px 20px;
    }
}

@media (max-width: 480px) {
    .folder-card-header h3 {
        font-size: 14px;
    }

    .file-name {
        font-size: 12.5px;
    }
}
