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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

header h1 {
    font-size: 2em;
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-container {
    flex: 1;
    position: relative;
    min-width: 200px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-result-item:hover {
    background: #f5f5f5;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-icon {
    font-size: 1.2em;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-path {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-actions {
    flex-shrink: 0;
}

.user-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 10px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.user-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.user-menu {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    z-index: 101;
    border: 1px solid #ddd;
}

.user-menu-item {
    padding: 12px 16px;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    font-size: 14px;
}

.user-menu-item:hover {
    background: #e8ecff;
    color: #667eea;
}

.user-menu-item:last-child {
    border-bottom: none;
}

.user-menu-divider {
    border-bottom: 1px solid #ddd;
    margin: 8px 0;
}

.user-menu-user {
    padding: 14px 16px;
    border-bottom: 1px solid #ddd;
    font-weight: 700;
    color: #333;
    font-size: 14px;
}

.user-menu-user-email {
    font-size: 12px;
    color: #666;
    font-weight: normal;
    margin-top: 3px;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }
    
    .search-container {
        max-width: 90%;
    }
}

.tabs-container {
    border-bottom: 2px solid #eee;
    background: #f8f9fa;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px;
}

.tab {
    padding: 12px 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #666;
}

.tab:hover {
    background: #f0f0f0;
    border-color: #667eea;
}

.tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.content {
    padding: 30px;
    min-height: 400px;
}

.content-tab {
    display: none;
}

.content-tab.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    aspect-ratio: 2/3;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-5px);
    border-color: #667eea;
}

.card-icon {
    font-size: 3em;
    margin-bottom: 10px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-name {
    font-weight: 600;
    color: #333;
    word-break: break-word;
    padding: 0 8px 12px 8px;
    font-size: 12px;
    line-height: 1.2;
}

.card-count {
    font-size: 11px;
    color: #999;
    padding: 0 8px 12px 8px;
}

.card.folder {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-color: #667eea;
}

.card.file {
    background: linear-gradient(135deg, #f093fb15 0%, #f5576c15 100%);
}

.breadcrumb {
    margin-bottom: 20px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 5px;
    font-size: 14px;
}

.breadcrumb a {
    color: #667eea;
    cursor: pointer;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 5px;
    color: #999;
}

.no-items {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* PDF Modal */
.pdf-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.pdf-modal.active {
    display: flex;
}

.pdf-modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    height: 90vh;
    max-width: 1000px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.pdf-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
}

.pdf-modal-close:hover {
    background: #764ba2;
    transform: scale(1.1);
}

.pdf-viewer {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 20px;
}

.pdf-thumbnail {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
    border-radius: 0;
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-thumbnail canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pdf-thumbnail-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
}

/* PDF Reader Toolbar */
.pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 1px solid #ddd;
    gap: 20px;
}

.pdf-toolbar-left,
.pdf-toolbar-center,
.pdf-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pdf-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.pdf-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pdf-close-btn {
    margin-left: auto;
}

.pdf-page-info {
    color: white;
    font-size: 13px;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.pdf-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    gap: 15px;
}

.pdf-page {
    max-width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.pagination-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pagination-info {
    color: #666;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
    font-size: 14px;
}

/* Auth Modal */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.auth-modal.active {
    display: flex;
}

.auth-modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 900px;
    padding: 0;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    min-height: 500px;
}

.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.auth-modal-close:hover {
    color: #333;
}

.auth-section {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-section.login {
    background: white;
    border-right: 1px solid #eee;
}

.auth-section.register {
    background: linear-gradient(135deg, #f5f7ff 0%, #e8ecff 100%);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.auth-subtitle {
    font-size: 13px;
    color: #999;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.form-group input,
.form-group select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    transition: all 0.2s ease;
}

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

.auth-error {
    background: #fee;
    color: #c33;
    padding: 10px 12px;
    border-radius: 5px;
    font-size: 12px;
    border: 1px solid #fcc;
    display: none;
}

.auth-error.show {
    display: block;
}

.auth-success {
    background: #efe;
    color: #3c3;
    padding: 10px 12px;
    border-radius: 5px;
    font-size: 12px;
    border: 1px solid #cfc;
    display: none;
}

.auth-success.show {
    display: block;
}

.auth-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-toggle {
    text-align: center;
    color: #999;
    font-size: 13px;
    margin-top: 15px;
}

.auth-toggle a {
    color: #667eea;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
}

.auth-toggle a:hover {
    text-decoration: underline;
}

/* Admin Panel */
.admin-panel {
    padding: 20px;
    max-width: 1200px;
}

.admin-panel h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.admin-panel h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.admin-panel h4 {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 600;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    font-size: 13px;
}

.admin-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.admin-table tr:hover {
    background: #f9f9f9;
}

.admin-btn-small {
    padding: 6px 12px;
    margin-right: 5px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.admin-btn-small:hover {
    background: #764ba2;
    transform: scale(1.05);
}

.admin-btn-small.delete {
    background: #dc3545;
}

.admin-btn-small.delete:hover {
    background: #c82333;
}

.nivel-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.nivel-admin {
    background: #ffc107;
    color: #333;
}

.nivel-colaborador {
    background: #28a745;
    color: white;
}

.nivel-apreciador {
    background: #17a2b8;
    color: white;
}

.admin-edit-form {
    max-width: 500px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.admin-edit-form h4 {
    margin-top: 20px;
}

@media (max-width: 768px) {
    .auth-modal-content {
        flex-direction: column;
        max-width: 95%;
        min-height: auto;
    }
    
    .auth-section {
        padding: 30px 20px;
    }
    
    .auth-section.login {
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    .auth-section.register {
        background: linear-gradient(135deg, #f5f7ff 0%, #e8ecff 100%);
    }
}
