/* Estilos do Sistema de Ótica */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header .header-container {
    position: relative;
    overflow: hidden;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

header .header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    opacity: 0.2;
    z-index: 0;
    pointer-events: none;
}

header .header-container h1 {
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: 2em;
    width: 100%;
}

header h1 {
    text-align: center;
    font-size: 2em;
}

/* Navigation */
nav {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav ul li {
    margin: 0;
}

nav ul li a {
    display: block;
    padding: 15px 25px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

nav ul li a:hover,
nav ul li a.active {
    background-color: #f8f9fa;
    border-bottom-color: #667eea;
    color: #667eea;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card h2 {
    color: #667eea;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dbe2f0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fbfcff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
    background: white;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

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

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    width: min(720px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef2ff;
}

.modal-header h2 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.modal-close {
    border: none;
    background: #f3f4f6;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    line-height: 1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #334155;
    background: #e2e8f0;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #5b6cf2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #4959dc 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.25);
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    color: #334155;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

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

table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

table th,
table td {
    padding: 12px;
    text-align: left;
}

table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

table tbody tr:hover {
    background-color: #f8f9fa;
}

table tbody tr:last-child {
    border-bottom: none;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

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

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

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 10px;
}

.stat-card p {
    color: #666;
    font-size: 14px;
}

/* Search and Filters */
.search-box {
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 20px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination .btn {
    min-width: 40px;
    padding: 8px 12px;
}

.pagination .btn-primary {
    background-color: #667eea;
    color: white;
    cursor: default;
}

.pagination .btn-primary:hover {
    transform: none;
    box-shadow: none;
}

.pagination-ellipsis {
    padding: 8px 5px;
    color: #666;
}

.pagination-info {
    text-align: center;
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

/* Images Grid */
.images-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.image-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid #e0e0e0;
}

.image-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.image-container {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.image-container a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s;
}

.image-container img:hover {
    transform: scale(1.1);
}

.image-container::after {
    content: '🔍';
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.image-container:hover::after {
    opacity: 1;
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

.image-info {
    padding: 8px;
    text-align: center;
}

.image-info h4 {
    margin: 0 0 5px 0;
    color: #667eea;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-info p {
    margin: 3px 0;
    font-size: 10px;
    color: #666;
    display: none;
}

.image-info strong {
    color: #333;
}

/* Mostrar informações completas no hover (opcional) */
.image-item:hover .image-info p {
    display: block;
}

/* Modal para imagens */
.modal-image-viewer {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.95);
    cursor: pointer;
}

.modal-image-viewer.active {
    display: block;
}

.modal-image-viewer .modal-content {
    margin: auto;
    display: block;
    width: auto;
    max-width: 95%;
    max-height: 95vh;
    margin-top: 2.5vh;
    animation: zoom 0.3s;
    cursor: default;
    pointer-events: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border-radius: 4px;
}

@keyframes zoom {
    from {transform: scale(0)}
    to {transform: scale(1)}
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #f1f1f1;
    font-size: 45px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0,0,0,0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.3s, transform 0.3s;
}

.close-modal:hover,
.close-modal:focus {
    color: #fff;
    background: rgba(0,0,0,0.8);
    transform: scale(1.1);
    text-decoration: none;
}

#modalCaption {
    margin: 20px auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #fff;
    padding: 15px;
    font-size: 16px;
    background: rgba(0,0,0,0.5);
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 8px;
    }

    .images-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .image-container {
        height: 100px;
    }
    
    .image-info h4 {
        font-size: 11px;
    }
}


