/**
 * PDF Editor Pro - Main CSS
 * Shared styles extracted from inline CSS across all modules
 * Version 2.0.0
 */

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* ============================================
   HEADER STYLES
   ============================================ */
.main-header {
    height: 60px;
    background: white;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.2s;
}

.logo:hover {
    color: #667eea;
}

.logo i {
    font-size: 28px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-email {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.btn-login,
.btn-register {
    padding: 8px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-login {
    color: #667eea;
    background: #f0f2f5;
}

.btn-login:hover {
    background: #e1e2e6;
}

.btn-register {
    color: white;
    background: #667eea;
}

.btn-register:hover {
    background: #5a6fd6;
}

.btn-logout,
.btn-admin {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-logout {
    background: #e74c3c;
    color: white;
}

.btn-logout:hover {
    background: #d43f2f;
}

.btn-admin {
    background: #667eea;
    color: white;
}

.btn-admin:hover {
    background: #5a6fd6;
}

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */
.main-layout {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e0e0e0;
    min-height: calc(100vh - 60px);
    position: sticky;
    top: 60px;
    overflow-y: auto;
    transition: width 0.3s ease, transform 0.3s ease;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 15px;
    background: none;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    font-size: 20px;
    color: #666;
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: #f5f7fa;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
}

.sidebar-item:hover {
    background: #f5f7fa;
    color: #667eea;
}

.sidebar-item.active {
    background: #e8eaf6;
    color: #667eea;
    border-left: 3px solid #667eea;
    font-weight: 600;
}

.sidebar-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar.collapsed .sidebar-item span {
    display: none;
}

.sidebar-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 10px 0;
}

/* Responsive sidebar */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        transform: translateX(-100%);
        z-index: 999;
        height: calc(100vh - 60px);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
    }
}

/* ============================================
   CONTENT WRAPPER
   ============================================ */
.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    padding: 40px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .content {
        padding: 20px;
    }
}

/* ============================================
   FOOTER
   ============================================ */
.main-footer {
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 20px 40px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    font-size: 15px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    background: #5a6fd6;
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: #667eea;
}

.btn-primary:hover {
    background: #5a6fd6;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #d43f2f;
}

.btn-success {
    background: #2ecc71;
}

.btn-success:hover {
    background: #27ae60;
}

.btn-disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

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

/* ============================================
   CARDS
   ============================================ */
.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.card-icon {
    width: 80px;
    height: 80px;
    background: #f0f2f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: #667eea;
}

.card h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 20px;
}

.card p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.badge-free {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-pro {
    background: #fff3e0;
    color: #f57c00;
}

.badge-admin {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Status badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-processing {
    background: #fff3cd;
    color: #856404;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.status-pending {
    background: #d1ecf1;
    color: #0c5460;
}

/* ============================================
   TABLES
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    color: #333;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

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

table tr:hover {
    background: #f8f9fa;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #34495e;
    font-weight: 600;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.form-control.error {
    border-color: #e74c3c;
}

/* ============================================
   CUSTOM MODALS (not Bootstrap modals)
   Note: Use .custom-modal class, NOT .modal, to avoid Bootstrap conflicts
   ============================================ */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.custom-modal {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 550px;
    width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.custom-modal h2 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 24px;
}

.custom-modal p {
    color: #7f8c8d;
    margin: 0 0 25px 0;
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================
   LOADING & SPINNER
   ============================================ */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 200000;
    opacity: 0;
    transform: translateX(400px);
    transition: opacity 0.3s, transform 0.3s;
    max-width: 400px;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid #2ecc71;
}

.notification-error {
    border-left: 4px solid #e74c3c;
}

.notification-warning {
    border-left: 4px solid #f39c12;
}

.notification-info {
    border-left: 4px solid #3498db;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-30 {
    margin-top: 30px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}