/* WordPress Drive - Frontend CSS */

/* Variáveis CSS */
:root {
    --wp-drive-primary: #0073aa;
    --wp-drive-primary-dark: #005a87;
    --wp-drive-secondary: #f7f7f7;
    --wp-drive-border: #ddd;
    --wp-drive-text: #333;
    --wp-drive-text-light: #666;
    --wp-drive-success: #46b450;
    --wp-drive-error: #dc3232;
    --wp-drive-warning: #ffb900;
    --wp-drive-shadow: 0 1px 1px rgba(0,0,0,0.04);
    --wp-drive-radius: 4px;
}

/* Container principal */
.wp-drive-container {
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--wp-drive-border);
    border-radius: var(--wp-drive-radius);
    box-shadow: var(--wp-drive-shadow);
}

.wp-drive-header {
    background: var(--wp-drive-secondary);
    padding: 20px;
    border-bottom: 1px solid var(--wp-drive-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.wp-drive-title {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--wp-drive-text);
    margin: 0;
}

.wp-drive-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Breadcrumb */
.wp-drive-breadcrumb {
    padding: 15px 20px;
    background: #fafafa;
    border-bottom: 1px solid var(--wp-drive-border);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.wp-drive-breadcrumb-item {
    color: var(--wp-drive-text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.wp-drive-breadcrumb-item:hover {
    color: var(--wp-drive-primary);
}

.wp-drive-breadcrumb-separator {
    color: var(--wp-drive-text-light);
    opacity: 0.5;
}

.wp-drive-breadcrumb-current {
    color: var(--wp-drive-text);
    font-weight: 500;
}

/* Barra de ferramentas */
.wp-drive-toolbar {
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid var(--wp-drive-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.wp-drive-view-toggle {
    display: flex;
    background: var(--wp-drive-secondary);
    border-radius: var(--wp-drive-radius);
    overflow: hidden;
}

.wp-drive-view-toggle button {
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--wp-drive-text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.wp-drive-view-toggle button.active {
    background: var(--wp-drive-primary);
    color: #fff;
}

.wp-drive-search {
    flex: 1;
    max-width: 300px;
}

.wp-drive-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--wp-drive-border);
    border-radius: var(--wp-drive-radius);
    font-size: 14px;
}

/* Área de conteúdo */
.wp-drive-content {
    padding: 20px;
    min-height: 400px;
}

/* Grid View */
.wp-drive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.wp-drive-item {
    background: #fff;
    border: 1px solid var(--wp-drive-border);
    border-radius: var(--wp-drive-radius);
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.wp-drive-item:hover {
    border-color: var(--wp-drive-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.wp-drive-item.selected {
    border-color: var(--wp-drive-primary);
    background: #f0f6fc;
}

.wp-drive-item-icon {
    font-size: 48px;
    margin-bottom: 10px;
    color: var(--wp-drive-text-light);
}

.wp-drive-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--wp-drive-text);
    margin-bottom: 5px;
    word-break: break-word;
}

.wp-drive-item-info {
    font-size: 12px;
    color: var(--wp-drive-text-light);
}

.wp-drive-item-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.wp-drive-item:hover .wp-drive-item-actions {
    opacity: 1;
}

.wp-drive-item-actions button {
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--wp-drive-border);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0 2px;
    cursor: pointer;
    transition: all 0.2s;
}

.wp-drive-item-actions button:hover {
    background: var(--wp-drive-primary);
    color: #fff;
    border-color: var(--wp-drive-primary);
}

/* List View */
.wp-drive-list {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.wp-drive-list th,
.wp-drive-list td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--wp-drive-border);
}

.wp-drive-list th {
    background: var(--wp-drive-secondary);
    font-weight: 600;
    color: var(--wp-drive-text);
}

.wp-drive-list tr:hover {
    background: #f9f9f9;
}

.wp-drive-list-icon {
    font-size: 20px;
    margin-right: 10px;
    vertical-align: middle;
}

.wp-drive-list-name {
    font-weight: 500;
    color: var(--wp-drive-text);
}

.wp-drive-list-info {
    color: var(--wp-drive-text-light);
    font-size: 13px;
}

/* Upload Area */
.wp-drive-upload-area {
    border: 2px dashed var(--wp-drive-border);
    border-radius: var(--wp-drive-radius);
    padding: 40px 20px;
    text-align: center;
    background: var(--wp-drive-secondary);
    transition: all 0.3s;
    cursor: pointer;
}

.wp-drive-upload-area:hover,
.wp-drive-upload-area.dragover {
    border-color: var(--wp-drive-primary);
    background: #f0f6fc;
}

.wp-drive-upload-area.dragover {
    transform: scale(1.02);
}

.wp-drive-upload-icon {
    font-size: 48px;
    color: var(--wp-drive-text-light);
    margin-bottom: 15px;
}

.wp-drive-upload-text {
    font-size: 16px;
    color: var(--wp-drive-text);
    margin-bottom: 10px;
}

.wp-drive-upload-hint {
    font-size: 14px;
    color: var(--wp-drive-text-light);
}

.wp-drive-upload-input {
    display: none;
}

/* Progress Bar */
.wp-drive-progress {
    margin-top: 20px;
}

.wp-drive-progress-bar {
    height: 8px;
    background: var(--wp-drive-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.wp-drive-progress-fill {
    height: 100%;
    background: var(--wp-drive-success);
    transition: width 0.3s;
}

.wp-drive-progress-text {
    margin-top: 8px;
    font-size: 13px;
    color: var(--wp-drive-text-light);
}

/* Modal */
.wp-drive-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 100000;
}

.wp-drive-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-drive-modal-content {
    background: #fff;
    border-radius: var(--wp-drive-radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.wp-drive-modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--wp-drive-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wp-drive-modal-title {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--wp-drive-text);
    margin: 0;
}

.wp-drive-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--wp-drive-text-light);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.wp-drive-modal-close:hover {
    background: var(--wp-drive-secondary);
    color: var(--wp-drive-text);
}

.wp-drive-modal-body {
    padding: 20px;
}

.wp-drive-modal-footer {
    padding: 20px;
    border-top: 1px solid var(--wp-drive-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Formulários */
.wp-drive-form-group {
    margin-bottom: 20px;
}

.wp-drive-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--wp-drive-text);
}

.wp-drive-form-input,
.wp-drive-form-select,
.wp-drive-form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--wp-drive-border);
    border-radius: var(--wp-drive-radius);
    font-size: 14px;
    transition: border-color 0.2s;
}

.wp-drive-form-input:focus,
.wp-drive-form-select:focus,
.wp-drive-form-textarea:focus {
    outline: none;
    border-color: var(--wp-drive-primary);
}

.wp-drive-form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Botões */
.wp-drive-button {
    padding: 10px 20px;
    border: 1px solid var(--wp-drive-border);
    border-radius: var(--wp-drive-radius);
    background: #fff;
    color: var(--wp-drive-text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    line-height: 1.4;
}

.wp-drive-button:hover {
    background: var(--wp-drive-secondary);
}

.wp-drive-button.primary {
    background: var(--wp-drive-primary);
    color: #fff;
    border-color: var(--wp-drive-primary);
}

.wp-drive-button.primary:hover {
    background: var(--wp-drive-primary-dark);
}

.wp-drive-button.success {
    background: var(--wp-drive-success);
    color: #fff;
    border-color: var(--wp-drive-success);
}

.wp-drive-button.danger {
    background: var(--wp-drive-error);
    color: #fff;
    border-color: var(--wp-drive-error);
}

.wp-drive-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Notificações */
.wp-drive-notice {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: var(--wp-drive-radius);
    border-left: 4px solid;
}

.wp-drive-notice.success {
    background: #f7fff7;
    border-color: var(--wp-drive-success);
    color: var(--wp-drive-success);
}

.wp-drive-notice.error {
    background: #fff7f7;
    border-color: var(--wp-drive-error);
    color: var(--wp-drive-error);
}

.wp-drive-notice.warning {
    background: #fffbf0;
    border-color: var(--wp-drive-warning);
    color: var(--wp-drive-warning);
}

/* Estatísticas */
.wp-drive-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.wp-drive-stat-card {
    background: #fff;
    border: 1px solid var(--wp-drive-border);
    border-radius: var(--wp-drive-radius);
    padding: 20px;
    text-align: center;
}

.wp-drive-stat-number {
    font-size: 2em;
    font-weight: 600;
    color: var(--wp-drive-primary);
    margin-bottom: 5px;
}

.wp-drive-stat-label {
    font-size: 14px;
    color: var(--wp-drive-text-light);
}

/* Empty State */
.wp-drive-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--wp-drive-text-light);
}

.wp-drive-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.wp-drive-empty-title {
    font-size: 1.2em;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--wp-drive-text);
}

.wp-drive-empty-text {
    font-size: 14px;
    margin-bottom: 20px;
}

/* Loading */
.wp-drive-loading {
    text-align: center;
    padding: 40px;
}

.wp-drive-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--wp-drive-border);
    border-top-color: var(--wp-drive-primary);
    border-radius: 50%;
    animation: wp-drive-spin 1s linear infinite;
}

@keyframes wp-drive-spin {
    to { transform: rotate(360deg); }
}

/* Responsividade */
@media (max-width: 768px) {
    .wp-drive-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .wp-drive-actions {
        justify-content: center;
    }
    
    .wp-drive-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .wp-drive-search {
        max-width: none;
    }
    
    .wp-drive-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }
    
    .wp-drive-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .wp-drive-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .wp-drive-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .wp-drive-item {
        padding: 10px;
    }
    
    .wp-drive-item-icon {
        font-size: 36px;
    }
    
    .wp-drive-item-name {
        font-size: 12px;
    }
    
    .wp-drive-list th,
    .wp-drive-list td {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* Acessibilidade */
.wp-drive-item:focus,
.wp-drive-button:focus {
    outline: 2px solid var(--wp-drive-primary);
    outline-offset: 2px;
}

.wp-drive-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* Tema escuro (opcional) */
@media (prefers-color-scheme: dark) {
    :root {
        --wp-drive-primary: #4a9eff;
        --wp-drive-primary-dark: #2e8fff;
        --wp-drive-secondary: #2d2d2d;
        --wp-drive-border: #444;
        --wp-drive-text: #fff;
        --wp-drive-text-light: #ccc;
    }
    
    .wp-drive-container {
        background: #1a1a1a;
    }
    
    .wp-drive-header {
        background: var(--wp-drive-secondary);
    }
    
    .wp-drive-breadcrumb {
        background: #252525;
    }
    
    .wp-drive-item:hover {
        background: #2d2d2d;
    }
    
    .wp-drive-list tr:hover {
        background: #2d2d2d;
    }
}
