/* AIO-TikTok License Manager - Main Application Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
    overflow: visible;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-dropdown {
    position: relative;
    z-index: 999999 !important;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
    border: 2px solid #e5e7eb;
}

.user-dropdown-toggle:hover {
    background: #f9fafb;
    border-color: #667eea;
}

.user-dropdown-menu {
    position: fixed !important;
    top: 80px !important;
    right: 20px !important;
    margin-top: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 999999 !important;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.user-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.user-dropdown-header .user-name {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
    margin-bottom: 4px;
}

.user-dropdown-header .user-role {
    font-size: 12px;
    color: #6b7280;
}

.user-dropdown-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.user-dropdown-item:hover {
    background: #f3f4f6;
}

.user-dropdown-item i {
    width: 20px;
    text-align: center;
    color: #667eea;
}

.user-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

.btn {
    padding: 5px 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #868f96 0%, #596164 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

/* Navigation */
.nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(135deg, #667eea 0%, #6e62c2 100%);
    padding: 15px 20px;
    /* border-radius: 0 0 15px 15px; */
    /* backdrop-filter: blur(10px); */
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.nav a {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav a:hover, .nav a.active {
    background: #aab0d9;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: #3a57db;
}

/* Content Card */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Alerts - Hidden, all pages use toast */
.alert {
    display: none !important;
}

/* Toast Notification */
.toast-container {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    left: auto !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    max-width: 400px !important;
    width: auto !important;
    pointer-events: none !important;
}

.toast-container > * {
    pointer-events: auto !important;
}

.toast {
    background: white !important;
    border-radius: 12px !important;
    padding: 16px 20px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    min-width: 300px !important;
    max-width: 100% !important;
    width: auto !important;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s !important;
    position: relative !important;
    overflow: hidden !important;
    z-index: 1000000 !important;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.toast.toast-success::before {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast.toast-error::before {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #059669;
}

.toast-error .toast-icon {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    color: #111827;
}

.toast-message {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.3) 0%, rgba(16, 185, 129, 0.6) 100%);
    animation: progressBar 3s linear;
}

.toast-error .toast-progress {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.3) 0%, rgba(239, 68, 68, 0.6) 100%);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 10px 7px 10px 7px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
}

th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

tr:hover {
    background: #f9fafb;
}

/* Form */
.form-group {
    margin-bottom: 15px;
}

/* 2-Column Form Layout */
.form-row-2cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-col {
    display: flex;
    flex-direction: column;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
    .form-row-2cols {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Badge */
.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 20px;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    overflow-y: auto;
    position: relative;
    z-index: 1000000;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #667eea;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-modal, .btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.close-modal:hover, .btn-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Confirm Modal Styles */
.confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.confirm-modal.active {
    display: flex;
}

.confirm-modal-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.confirm-modal-header {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    padding: 25px;
    text-align: center;
    color: white;
}

.confirm-modal-header i {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
    animation: shake 0.5s ease;
}

.confirm-modal-header h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.confirm-modal-body {
    padding: 30px;
    text-align: center;
}

.confirm-modal-message {
    font-size: 16px;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 30px;
}

.confirm-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-btn {
    padding: 12px 32px;
    border-radius: 10px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.confirm-btn-danger {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.confirm-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.5);
}

.confirm-btn-cancel {
    background: #e5e7eb;
    color: #374151;
}

.confirm-btn-cancel:hover {
    background: #d1d5db;
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-5deg); }
    20%, 40%, 60%, 80% { transform: rotate(5deg); }
}

/* Utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }

/* Quản lý User - Tách CSS inline từ Blade */
.users-title {
    font-size: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.users-pending-badge {
    font-size: 13px;
    padding: 6px 12px;
}
.users-table-header {
    font-size: 12px;
}
.users-table-row {
    font-size: 14px;
}
.users-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
}
.users-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.users-license-info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.users-license-count {
    font-weight: 600;
    font-size: 12px;
    color: #1f2937;
}
.users-link {
    padding: 4px 8px;
    font-size: 11px;
    text-decoration: none;
}
.users-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}
.users-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.users-empty-cell {
    padding: 60px;
    color: #6b7280;
}
.users-empty-icon {
    font-size: 64px;
    opacity: 0.2;
    margin-bottom: 15px;
    display: block;
}
.users-empty-title {
    font-size: 18px;
    font-weight: 600;
}
.users-modal-note {
    color: #6b7280;
}
.users-edit-avatar-preview {
    margin-bottom: 10px;
}
.users-password-info {
    background: #e0f2fe;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.users-password-info-text {
    margin: 0;
    color: #0369a1;
}
/* Quản lý License - Tách CSS inline từ Blade */
.licenses-title {
    font-size: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.licenses-success-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}
.licenses-success-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    max-width: 550px;
    width: 90%;
    text-align: center;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.licenses-success-icon {
    font-size: 64px;
    margin-bottom: 20px;
}
.licenses-success-title {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: bold;
}
.licenses-success-desc {
    margin: 0 0 25px 0;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}
.licenses-success-list {
    background: rgba(255,255,255,0.15);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    max-height: 250px;
    overflow-y: auto;
}
.licenses-success-label {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 10px;
}
.licenses-success-ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}
.licenses-success-li {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.licenses-success-input {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    font-size: 14px;
    font-family: monospace;
    background: rgba(255,255,255,0.9);
    color: #333;
    font-weight: bold;
    letter-spacing: 1px;
}
.licenses-success-copy {
    padding: 6px 12px;
    border: none;
    background: rgba(255,255,255,0.9);
    color: #667eea;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}
.licenses-success-copy:hover {
    background: white;
    transform: scale(1.05);
}
.licenses-success-copy:not(:hover) {
    background: rgba(255,255,255,0.9);
    transform: scale(1);
}
.licenses-success-close {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(255,255,255,0.5);
    background: transparent;
    color: white;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}
.licenses-success-close:hover {
    background: rgba(255,255,255,0.1);
}
.licenses-success-close:not(:hover) {
    background: transparent;
}

/* Badge License Remaining (Còn lại ở License) */
.badge-license-remaining {
    color: #10b981;
    font-weight: 600;
    font-size: 13px;
}

/* Quản lý Gói - Tách CSS inline từ Blade */
.plans-header {
    margin-bottom: 20px;
}
.plans-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.plans-search {
    margin-bottom: 20px;
}
.plans-search-input {
    flex: 1;
}
.plans-status-filter {
    width: 200px;
}
.plans-bulk-actions {
    margin-bottom: 20px;
}
.plans-table th {
    width: 40px;
}
.plans-table-row {
    font-size: 12px;
}
.plans-table-desc {
    max-width: 300px;
    font-size: 13px;
    color: #6b7280;
}
.plans-table-price {
    font-weight: 600;
    color: #f5576c;
}
.plans-table-sort {
    text-align: center;
}
.plans-table-empty {
    padding: 60px;
    color: #6b7280;
}
.plans-table-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}
.plans-table-empty-title {
    margin: 0;
}
.plans-table-empty-desc {
    margin: 10px 0 0 0;
    font-size: 13px;
}
.plans-pagination {
    margin-top: 20px;
}
.plans-modal-content {
    max-width: 600px;
}
.plans-modal-form-group {
    flex: 1;
}

/* Badge Info (Thời hạn gói) */
.badge-info {
    background: #e0e7ff;
    color: #3730a3;
}

/* Nhẹ nhàng hover cho các nút action icon-only */
.btn-outline-info.btn-sm:hover,
.btn-outline-warning.btn-sm:hover,
.btn-outline-danger.btn-sm:hover,
.btn-outline-primary.btn-sm:hover,
.btn-outline-secondary.btn-sm:hover {
    background-color: rgba(0,0,0,0.06) !important;
    color: inherit !important;
    box-shadow: none !important;
    border-color: inherit !important;
}
