/* RESET E BASE */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
:root {
    --primary-color: #3a7bd5;
    --primary-dark: #2a5ca0;
    --secondary-color: #00d2ff;
    --accent-color: #6a11cb;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f8f9fa;
    --card-bg: rgba(255, 255, 255, 0.9);
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --box-shadow: 0 12px 25px rgba(0,0,0,0.15);
    --box-shadow-sm: 0 4px 12px rgba(0,0,0,0.08);
    --transition: all 0.3s ease;
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f6f9fc, #edf2f7);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* HEADER */
.main-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1a202c 100%);
    color: white;
    padding: 18px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.main-header h1 {
    font-size: 1.8em;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    background: linear-gradient(90deg, #fff, var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95em;
}
.lang-switcher span {
    opacity: 0.9;
}
.lang-switcher a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.lang-switcher a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: -1;
}
.lang-switcher a:hover::before,
.lang-switcher a.active::before {
    transform: translateY(0);
}
.lang-switcher a:hover,
.lang-switcher a.active {
    background: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* HERO & CATEGORIES */
.hero {
    text-align: center;
    margin: 40px 0;
    padding: 40px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    animation: pulse 15s infinite linear;
    z-index: 1;
}
.hero h1 {
    font-size: 2.6em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    position: relative;
    z-index: 2;
}
.hero p {
    font-size: 1.3em;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}
@keyframes pulse {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

h2 {
    margin: 30px 0 20px;
    color: #2c3e50;
    font-size: 1.8em;
}
.categories-grid,
.grid-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
    margin: 20px 0;
}
.category-card,
.link-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 28px 18px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}
.category-card::before,
.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.category-card::after,
.link-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.category-card:hover,
.link-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow);
    border-color: rgba(0,0,0,0);
}
.category-card:hover::before,
.link-card:hover::before {
    transform: scaleX(1);
}
.category-card:hover::after,
.link-card:hover::after {
    opacity: 1;
}
.category-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
}
.link-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 2px solid #eee;
}
.placeholder-icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: #aaa;
}
.link-card h3,
.category-card h3 {
    font-size: 1.2em;
    margin: 10px 0;
    color: #2c3e50;
}

/* BOTÕES */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(58, 123, 213, 0.2);
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    z-index: -1;
}
.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(58, 123, 213, 0.3);
}
.btn:hover::before {
    transform: translateX(100%);
}
.btn-back {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1em;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-back:hover {
    color: var(--primary-dark);
    transform: translateX(-4px);
}

/* INFO BOX */
.info-box {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin: 40px 0;
}
.info-box ul {
    padding-left: 20px;
    margin-top: 15px;
}
.info-box li {
    margin-bottom: 12px;
    line-height: 1.6;
}

/* IFRAME VIEW */
.iframe-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
    justify-content: space-between;
}
.iframe-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2c3e50;
}
.iframe-header h2 i {
    color: #3498db;
}
.loader {
    text-align: center;
    padding: 40px;
    font-size: 1.3em;
    color: #555;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.loader i {
    font-size: 2em;
    color: #3498db;
}
.iframe-wrapper {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    min-height: 800px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.iframe-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}
.site-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2c3e50;
    font-weight: 500;
}
.btn-reload {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 1.1em;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}
.btn-reload:hover {
    background: #eaf2f8;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 0.9em;
}

/* PAINEL ADMIN */
.admin-panel {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.admin-section {
    margin-bottom: 30px;
}

.admin-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-section h3 i {
    color: #3498db;
}

.admin-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

.table-responsive {
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: bold;
    color: #2c3e50;
}

tr:hover td {
    background: #f5f9ff;
}

.url-cell {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.actions-cell {
    display: flex;
    gap: 10px;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-action.edit {
    background: #3498db;
}

.btn-action.delete {
    background: #e74c3c;
}

.btn-action:hover {
    transform: scale(1.1);
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.btn-logout {
    background: #e74c3c;
}
/* FORMULÁRIOS */
.admin-form {
    max-width: 720px;
    margin: 30px auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    padding: 24px;
}
.form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}
.form-header h2 {
    margin: 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-header h2 i {
    color: #3498db;
}
.form-group {
    margin-bottom: var(--spacing-lg);
    position: relative;
}
.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-color);
    transition: var(--transition);
}
.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-light);
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--border-radius-sm);
    background-color: rgba(255,255,255,0.9);
    transition: var(--transition);
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.15);
    background-color: #fff;
}
.form-control::placeholder {
    color: #aaa;
    opacity: 0.7;
}
.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.btn-primary {
    background: linear-gradient(to right, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.3s;
}
.btn-primary:hover {
    background: #2573c0;
}
.btn-secondary {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: background 0.3s;
}
.btn-secondary:hover {
    background: #7f8c8d;
}
.current-image {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.current-image img {
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    border: 1px solid #eee;
}

/* LOGIN */
.login-page {
    background: linear-gradient(135deg, #3498db, #8e44ad);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-container {
    max-width: 400px;
    width: 100%;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.login-header {
    text-align: center;
    margin-bottom: 25px;
}
.login-header h2 {
    color: #2c3e50;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.login-header h2 i {
    color: #3498db;
}
.login-subtitle {
    color: #7f8c8d;
    margin: 0;
    font-size: 0.9em;
}

form input[type="text"],
form input[type="url"],
form input[type="password"],
form select,
form input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
}
form button {
    margin-top: 10px;
}

/* FOOTER */
.main-footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 25px 0;
    margin-top: 50px;
}

/* FOOTER */
.site-footer {
    background: linear-gradient(to right, #2c3e50, #1a252f);
    color: #ecf0f1;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 30px;
}

.footer-logo h3 {
    color: #3498db;
    margin: 0 0 10px;
    font-size: 1.5em;
}

.footer-logo p {
    color: #bdc3c7;
    margin: 0;
}

.footer-links {
    margin-top: 10px;
}

.footer-links h4 {
    color: #3498db;
    margin: 0 0 15px;
    font-size: 1.2em;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ecf0f1;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #3498db;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(236, 240, 241, 0.1);
    color: #bdc3c7;
    font-size: 0.9em;
}

/* ANIMAÇÕES */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.fadeIn {
    animation: fadeIn 0.6s ease forwards;
}

.pulse {
    animation: pulse 2s infinite;
}

/* RESPONSIVO */
@media (max-width: 992px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
    margin: 40px 0;
}

.grid > * {
    animation: fadeIn 0.6s ease forwards;
    animation-delay: calc(var(--animation-order, 0) * 0.1s);
    opacity: 0;
}

@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
        text-align: center;
    }
    .hero {
        padding: 30px 20px;
    }
    .hero h1 {
        font-size: 1.8em;
    }
    .hero p {
        font-size: 1.1em;
    }
    .categories-grid,
    .grid-links {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    .iframe-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .category-card, 
    .link-card {
        padding: 20px 10px;
    }
    .info-box {
        padding: 20px 15px;
    }
    .footer-content {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.6em;
    }
    .categories-grid,
    .grid-links {
        grid-template-columns: 1fr 1fr;
    }
    .category-icon {
        font-size: 2em;
    }
    h2 {
        font-size: 1.5em;
    }
    .site-footer {
        padding: 30px 0 15px;
    }
}