/* Códigos GitHub - Frontend Styles */

.cafe-github-frontend {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cafe-github-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--theme-palette-color-7);
}

.cafe-github-header h2 {
    margin: 0;
    color: var(--theme-palette-color-1);
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 600;
}

.cafe-github-stats {
    color: var(--theme-palette-color-5);
    font-size: 14px;
}

/* Filtros */
.cafe-github-filters-frontend {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.cafe-github-filters-frontend select,
.cafe-github-filters-frontend input {
    padding: 10px 15px;
    border: 2px solid var(--theme-palette-color-4);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    background: var(--theme-palette-color-7);
    color: var(--theme-palette-color-1);
    min-width: 180px;
    transition: var(--transition);
}

.cafe-github-filters-frontend select:focus,
.cafe-github-filters-frontend input:focus {
    outline: none;
    border-color: var(--theme-palette-color-7);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.cafe-github-filters-frontend input::placeholder {
    color: var(--theme-palette-color-5);
}

/* Grid de Cards */
.cafe-github-cards {
    display: grid;
    gap: 25px;
}

.cafe-github-cards[data-layout="grid"] {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.cafe-github-cards[data-layout="list"] {
    grid-template-columns: 1fr;
}

/* Card Individual */
.cafe-github-card {
    background: var(--theme-palette-color-7);
    border: 2px solid var(--theme-palette-color-4);
    border-radius: 12px;
    padding: 25px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.cafe-github-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--theme-palette-color-7), var(--theme-palette-color-1));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.cafe-github-card:hover {
    transform: translateY(-5px);
    border-color: var(--theme-palette-color-7);
    box-shadow: var(--shadow-lg);
}

.cafe-github-card:hover::before {
    transform: scaleX(1);
}

.cafe-github-card-header {
    margin-bottom: 15px;
}

.cafe-github-card-header h3 {
    margin: 0 0 10px 0;
    color: var(--theme-palette-color-1);
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.cafe-github-card-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Badges de Linguagem */
.cafe-github-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.5px;
}

.cafe-github-badge-php { background: #777bb4; color: white; }
.cafe-github-badge-javascript { background: #f7df1e; color: #000; }
.cafe-github-badge-css { background: #1572b6; color: white; }
.cafe-github-badge-html { background: #e34f26; color: white; }
.cafe-github-badge-python { background: #3776ab; color: white; }
.cafe-github-badge-java { background: #007396; color: white; }
.cafe-github-badge-sql { background: #336791; color: white; }
.cafe-github-badge-bash { background: #4eaa25; color: white; }
.cafe-github-badge-json { background: #000000; color: white; }
.cafe-github-badge-xml { background: #ff6600; color: white; }

/* Badges de Dificuldade */
.cafe-github-difficulty {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.5px;
}

.cafe-github-difficulty-iniciante {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cafe-github-difficulty-intermediario {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.cafe-github-difficulty-avancado {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.cafe-github-card-body {
    margin-bottom: 20px;
}

.cafe-github-card-description {
    color: var(--theme-palette-color-2);
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 10px 0;
}

.cafe-github-card-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cafe-github-category {
    color: var(--theme-palette-color-5);
    font-size: 12px;
    font-weight: 500;
}

.cafe-github-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cafe-github-card-stats {
    display: flex;
    gap: 15px;
}

.cafe-github-stat {
    color: var(--theme-palette-color-5);
    font-size: 12px;
    font-weight: 500;
}

.cafe-github-view-btn {
    background: var(--theme-palette-color-7);
    color: var(--theme-palette-color-1);
    border: 2px solid var(--theme-palette-color-7);
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.cafe-github-view-btn:hover {
    background: var(--theme-palette-color-1);
    color: var(--theme-palette-color-7);
    transform: translateY(-1px);
}

/* Estado Vazio */
.cafe-github-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--theme-palette-color-5);
}

.cafe-github-empty p {
    font-size: 16px;
    margin: 0;
}

/* Modal */
.cafe-github-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.cafe-github-modal.show {
    display: flex;
}

.cafe-github-modal-content {
    background: var(--theme-palette-color-4);
    border-radius: 12px;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cafe-github-modal-header {
    background: var(--theme-palette-color-4);
    padding: 20px 25px;
    border-bottom: 2px solid var(--theme-palette-color-3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cafe-github-modal-header h3 {
    margin: 0;
    color: var(--theme-palette-color-7);
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 600;
}

.cafe-github-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--theme-palette-color-7);
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.cafe-github-modal-close:hover {
    background: var(--theme-palette-color-3);
    color: var(--theme-palette-color-7);
}

.cafe-github-modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--theme-palette-color-4);
}

.cafe-github-modal-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.cafe-github-modal-meta .cafe-github-category {
    color: var(--theme-palette-color-7);
}

.cafe-github-modal-description {
    color: var(--theme-palette-color-7);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.cafe-github-modal-description p {
    color: var(--theme-palette-color-7);
}

.cafe-github-code-container {
    background: #000000;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    border: 2px solid #333;
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.5),
        0 4px 12px rgba(0,0,0,0.4);
    position: relative;
}

.cafe-github-code-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), transparent);
    border-radius: 8px 8px 0 0;
    pointer-events: none;
}

.cafe-github-code-container::after {
    content: attr(data-language);
    position: absolute;
    top: 8px;
    right: 12px;
    background: rgba(0,0,0,0.3);
    color: #888;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
}

.cafe-github-code-container pre {
    margin: 0;
    padding-top: 25px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #f8f8f2;
    white-space: pre-wrap;
    word-wrap: break-word;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    position: relative;
    z-index: 1;
    background: transparent;
}

.cafe-github-code-container code {
    background: transparent;
    padding: 0;
    border: none;
    color: #f8f8f2;
    font-weight: 400;
}

/* Syntax highlighting básico para diferentes linguagens */
.cafe-github-code-container[data-language="php"] code {
    color: #f8f8f2;
}

.cafe-github-code-container[data-language="javascript"] code,
.cafe-github-code-container[data-language="js"] code {
    color: #f8f8f2;
}

.cafe-github-code-container[data-language="css"] code {
    color: #f8f8f2;
}

.cafe-github-code-container[data-language="html"] code {
    color: #f8f8f2;
}

.cafe-github-code-container[data-language="python"] code {
    color: #f8f8f2;
}

/* Melhorar contraste para comentários */
.cafe-github-code-container pre {
    position: relative;
}

/* Scrollbar customizada para o container de código */
.cafe-github-code-container::-webkit-scrollbar {
    height: 8px;
}

.cafe-github-code-container::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 4px;
}

.cafe-github-code-container::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.cafe-github-code-container::-webkit-scrollbar-thumb:hover {
    background: #777;
}

.cafe-github-modal-footer {
    padding: 20px 25px;
    background: var(--theme-palette-color-4);
    border-top: 2px solid var(--theme-palette-color-3);
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.cafe-github-copy-btn {
    background: var(--theme-palette-color-7);
    color: var(--theme-palette-color-1);
    border: 2px solid var(--theme-palette-color-7);
    padding: 12px 20px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cafe-github-copy-btn:hover {
    background: var(--theme-palette-color-1);
    color: var(--theme-palette-color-7);
    transform: translateY(-2px);
}

.cafe-github-copy-btn.copied {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.cafe-github-copy-btn.copied .cafe-github-copy-text::after {
    content: ' ✓';
}

.cafe-github-modal-footer button:last-child {
    background: transparent;
    color: var(--theme-palette-color-5);
    border: 2px solid var(--theme-palette-color-3);
}

.cafe-github-modal-footer button:last-child:hover {
    background: var(--theme-palette-color-3);
    color: var(--theme-palette-color-1);
}

/* Responsive */
@media (max-width: 768px) {
    .cafe-github-frontend {
        padding: 15px;
    }
    
    .cafe-github-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .cafe-github-header h2 {
        font-size: 24px;
    }
    
    .cafe-github-filters-frontend {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cafe-github-filters-frontend select,
    .cafe-github-filters-frontend input {
        min-width: 100%;
    }
    
    .cafe-github-cards[data-layout="grid"] {
        grid-template-columns: 1fr;
    }
    
    .cafe-github-card {
        padding: 20px;
    }
    
    .cafe-github-card-footer {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .cafe-github-view-btn {
        text-align: center;
    }
    
    .cafe-github-modal-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .cafe-github-modal-header,
    .cafe-github-modal-body,
    .cafe-github-modal-footer {
        padding: 15px;
    }
    
    .cafe-github-modal-footer {
        flex-direction: column;
    }
    
    .cafe-github-code-container {
        padding: 15px;
    }
    
    .cafe-github-code-container pre {
        font-size: 12px;
    }
}

/* Dark Mode Support */
.dark-mode .cafe-github-card {
    background: #2d3748;
    border-color: #4a5568;
}

.dark-mode .cafe-github-card:hover {
    border-color: #63b3ed;
}

.dark-mode .cafe-github-modal-content {
    background: #2d3748;
}

.dark-mode .cafe-github-modal-header {
    background: #4a5568;
    border-color: #718096;
}

.dark-mode .cafe-github-modal-footer {
    background: #4a5568;
    border-color: #718096;
}