/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: #f7fafc;
}

/* Container principale */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header interno (dopo il nuovo header) */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
    background: white;
    border-radius: 15px;
    color: #2d3748;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    color: #2d3748;
}

.header p {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 20px;
}

/* Header stile Clutch.co */
.top-header {
    background: #2d3748;
    color: white;
    padding: 8px 0;
    font-size: 14px;
}

.top-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.search-bar-top {
    display: flex;
    align-items: center;
    background: #4a5568;
    border-radius: 20px;
    padding: 5px 15px;
    flex: 1;
    max-width: 300px;
    margin-right: 20px;
}

.search-bar-top input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    width: 100%;
    padding: 5px;
}

.search-bar-top input::placeholder {
    color: #a0aec0;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-nav a {
    color: #e2e8f0;
    text-decoration: none;
    font-size: 13px;
}

.top-nav .btn-join {
    background: #e53e3e;
    color: white;
    padding: 6px 16px;
    border-radius: 4px;
    font-weight: 600;
}

/* Header principale */
.main-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
    color: #2d3748;
}

.logo .logo-icon {
    background: linear-gradient(45deg, #e53e3e, #ed8936);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.main-nav a {
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    position: relative;
}

.main-nav a.active {
    color: #e53e3e;
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    right: 0;
    height: 3px;
    background: #e53e3e;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-bar-main {
    display: flex;
    align-items: center;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    min-width: 200px;
}

.search-bar-main input {
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    padding: 0 8px;
}

.search-bar-main input::placeholder {
    color: #a0aec0;
}

.btn-primary {
    background: #e53e3e;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
}

/* Main Content Section - Stile Clutch.co */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
    color: #718096;
}

.breadcrumb a {
    color: #5a67d8;
    text-decoration: none;
}

.breadcrumb span {
    color: #4a5568;
}

.main-content-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    align-items: start;
}

.content-left {
    max-width: 100%;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 20px;
    line-height: 1.2;
}

.main-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #4a5568;
    margin-bottom: 20px;
    text-align: justify;
}

.read-more-link {
    color: #5a67d8;
    text-decoration: none;
    font-weight: 500;
}

.content-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-box {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    position: relative;
}

.info-icon {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 24px;
    height: 24px;
    background: #5a67d8;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.info-content {
    margin-left: 35px;
}

.info-content p {
    color: #4a5568;
    line-height: 1.5;
    margin: 0;
}

.info-content a {
    color: #5a67d8;
    text-decoration: none;
    font-weight: 500;
}

.ratings-update {
    text-align: right;
    font-size: 14px;
    color: #718096;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 30px 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #5a67d8;
    margin-bottom: 10px;
}

.stat-label {
    color: #4a5568;
    font-weight: 500;
}

/* Alert */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.alert-danger {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

.alert-warning {
    background: #fef5e7;
    color: #744210;
    border: 1px solid #fbd38d;
}

/* Stili per alert fissi (usati nella pagina categorie) */
#alerts {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

#alerts .alert {
    margin-bottom: 10px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.card h2 {
    margin-bottom: 25px;
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #5a67d8;
    box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.1);
}

.btn {
    background: #5a67d8;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

.btn-danger {
    background: #e53e3e;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.link-item {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.link-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-verified {
    background: #c6f6d5;
    color: #22543d;
}

.status-pending {
    background: #fef5e7;
    color: #744210;
}

.status-broken {
    background: #fed7d7;
    color: #742a2a;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .top-header-content,
    .main-header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .top-nav,
    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .search-bar-top,
    .search-bar-main {
        max-width: 100%;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 20px;
    }
}

@media (max-width: 1024px) {
    .main-content-section {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .content-right {
        order: -1;
    }
}

@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }
    
    .main-description {
        font-size: 1rem;
    }
    
    .info-box {
        padding: 15px;
    }
}

/* Stili aggiuntivi per la pagina categorie */
.btn-primary {
    background: #4299e1;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease;
}

.btn-primary:hover {
    background: #3182ce;
}

.btn-primary:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

/* Miglioramenti per i form */
.form-group select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
}

/* Miglioramenti per la responsività delle categorie */
@media (max-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .script-tabs {
        flex-wrap: wrap;
    }
    
    .script-tab {
        flex: 1;
        min-width: 120px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .add-link-form,
    .script-box,
    .category-box {
        padding: 20px;
    }
    
    .script-tabs {
        flex-direction: column;
    }
    
    .script-tab {
        border-radius: 8px;
        margin-bottom: 5px;
    }
}
