* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

.add-tool-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#toolUrl {
    flex: 1;
    min-width: 300px;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#toolUrl:focus {
    outline: none;
    border-color: #667eea;
}

#addTool {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

#addTool:hover {
    background: #5a67d8;
}

#addTool:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.search-filters {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.search-group {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

#searchInput, #categoryFilter {
    padding: 10px 14px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
}

#searchInput {
    flex: 1;
    min-width: 200px;
}

#categoryFilter {
    min-width: 180px;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 4px 12px;
    background: #f7fafc;
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.tag:hover {
    background: #667eea;
    color: white;
}

.tag.active {
    background: #667eea;
    color: white;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 1200px) {
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1200px) and (min-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.tool-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    padding: 20px;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* Eliminado .tool-thumbnail y reemplazado por header con logo */
.tool-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.tool-favicon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tool-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    flex: 1;
}

.tool-category {
    display: inline-block;
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tool-tag {
    padding: 4px 10px;
    background: #f7fafc;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #4a5568;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: #000;
    background: white;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 20px 20px;
    border-radius: 12px 12px 0 0;
    color: white;
}

.modal-info {
    text-align: center;
}

.modal-title-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

#modalFavicon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#modalTitle {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    color: white;
}

#modalUrl {
    color: #e2e8f0;
    font-size: 0.95rem;
    margin-bottom: 15px;
    word-break: break-all;
}

.modal-category {
    margin-bottom: 0;
}

.modal-category span {
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.modal-body {
    padding: 25px;
}

.modal-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    margin-top: 15px;
    color: #2d3748;
}

.modal-body h3:first-child {
    margin-top: 0;
}

#modalDescription {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
}

.modal-tag {
    padding: 6px 12px;
    background: #f7fafc;
    border: 1px solid #e1e5e9;
    border-radius: 16px;
    font-size: 0.8rem;
    color: #4a5568;
    font-weight: 500;
}

.open-tool-btn {
    width: 100%;
    padding: 14px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.open-tool-btn:hover {
    background: #5a67d8;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    #toolUrl {
        min-width: auto;
    }
    
    .search-group {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-title-header {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    #modalTitle {
        font-size: 1.4rem;
    }
}