/* License Management System Custom Styles */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --sidebar-width: 250px;
    --header-height: 60px;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    color: #2c3e50;
}

.main-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar.collapsed .sidebar-header h4 {
    display: none;
}

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

.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 5px 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    color: white;
    background-color: rgba(255,255,255,0.1);
    border-left-color: #ffd700;
}

.sidebar-menu i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}

.sidebar.collapsed .sidebar-menu a span {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 70px;
}

/* Header */
.header {
    background: white;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: between;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    margin-right: 15px;
    color: var(--dark-color);
    cursor: pointer;
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.language-selector select {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 5px 10px;
    background: white;
}

.user-menu {
    position: relative;
}

.user-menu .dropdown-menu {
    right: 0;
    left: auto;
}

/* Content Area */
.content-area {
    padding: 20px;
    min-height: calc(100vh - var(--header-height));
}

/* Page Header */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.page-header .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 5px 0 0 0;
}

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

.card-header {
    background: white;
    border-bottom: 1px solid #eee;
    border-radius: 10px 10px 0 0 !important;
    padding: 15px 20px;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
    color: var(--dark-color);
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.stats-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-card .icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.5rem;
    color: white;
}

.stats-card.primary .icon { background: var(--primary-color); }
.stats-card.success .icon { background: var(--success-color); }
.stats-card.danger .icon { background: var(--danger-color); }
.stats-card.warning .icon { background: var(--warning-color); }
.stats-card.info .icon { background: var(--info-color); }

.stats-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: var(--dark-color);
}

.stats-card p {
    margin: 5px 0 0 0;
    color: var(--secondary-color);
    font-weight: 500;
}

/* Tables */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

.table {
    margin: 0;
}

.table thead th {
    background: var(--light-color);
    border: none;
    font-weight: 600;
    color: var(--dark-color);
    padding: 15px;
}

.table tbody td {
    padding: 15px;
    vertical-align: middle;
    border-color: #eee;
}

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

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

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

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
}

/* Forms */
.form-control {
    border-radius: 6px;
    border: 1px solid #ddd;
    padding: 3px 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-group label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 5px;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 30px;
}

.login-header h3 {
    margin: 0;
    font-weight: 600;
}

.login-body {
    padding: 30px;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Status Badges */
.badge {
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: 15px;
}

.badge-success { background-color: var(--success-color); }
.badge-danger { background-color: var(--danger-color); }
.badge-warning { background-color: var(--warning-color); }
.badge-info { background-color: var(--info-color); }
.badge-secondary { background-color: var(--secondary-color); }

/* Modal */
.modal-content {
    border-radius: 10px;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #eee;
    padding: 20px;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid #eee;
    padding: 20px;
}

/* License Key Display */
.license-key {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color);
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
    text-align: center;
}

/* Plan Cards */
.plan-card {
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
}

.plan-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.plan-card.featured {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.plan-card h4 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 10px;
}

.plan-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 20px 0;
}

.plan-features {
    text-align: left;
    margin: 20px 0;
}

.plan-features li {
    padding: 5px 0;
    color: var(--dark-color);
}

.plan-features i {
    color: var(--success-color);
    margin-right: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 15px;
    }

    .stats-card {
        margin-bottom: 15px;
    }
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-info { color: var(--info-color) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-info { background-color: var(--info-color) !important; }

.cursor-pointer { cursor: pointer; }
.border-radius { border-radius: 10px; }

/* Modal Alert Popup Styles */
.modal-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999 !important;
    animation: fadeIn 0.3s ease;
}

.modal-alert-box {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideDown 0.4s ease;
    position: relative;
}

.modal-alert-header {
    padding: 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 20px;
}

.modal-alert-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.modal-alert-icon.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.modal-alert-icon.error {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
}

.modal-alert-icon.warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: white;
}

.modal-alert-icon.info {
    background: linear-gradient(135deg, #17a2b8 0%, #007bff 100%);
    color: white;
}

.modal-alert-title {
    flex: 1;
}

.modal-alert-title h3 {
    margin: 0 0 5px 0;
    font-size: 24px;
    font-weight: 600;
}

.modal-alert-title p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.modal-alert-body {
    padding: 30px;
}

.modal-alert-message {
    font-size: 16px;
    line-height: 1.6;
    color: #495057;
    margin-bottom: 20px;
}

.modal-alert-copy-section {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.modal-alert-copy-label {
    font-weight: 600;
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 10px;
    display: block;
}

.modal-alert-copy-value {
    background: white;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    word-break: break-all;
    user-select: all;
    margin-bottom: 15px;
}

.modal-alert-copy-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.modal-alert-copy-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-alert-copy-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.modal-alert-copy-btn.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.modal-alert-footer {
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-alert-close-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #6c757d;
    color: white;
}

.modal-alert-close-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.modal-alert-close-x {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #6c757d;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-alert-close-x:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

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

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

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

.modal-alert-overlay.closing {
    animation: fadeOut 0.3s ease;
}

.modal-alert-overlay.closing .modal-alert-box {
    animation: slideUp 0.3s ease;
}

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

/* DataTables Custom Styling */
.dataTables_wrapper {
    padding: 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 15px;
}

.dataTables_wrapper .dataTables_length select {
    padding: 5px 30px 5px 10px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    margin: 0 5px;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 6px 12px;
    margin-left: 8px;
    width: 250px;
}

.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.dataTables_wrapper .dataTables_info {
    padding-top: 15px;
    font-size: 0.9rem;
    color: #6c757d;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 15px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 5px 12px;
    margin: 0 2px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057 !important;
    transition: all 0.2s;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #667eea;
    color: white !important;
    border-color: #667eea;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #667eea;
    color: white !important;
    border-color: #667eea;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* DataTable row hover effect */
#licensesTable tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}

#licensesTable tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.08);
}

/* DataTable header styling */
#licensesTable thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border: none;
    padding: 12px 8px;
    cursor: pointer;
    user-select: none;
}

#licensesTable thead th:first-child {
    border-top-left-radius: 8px;
}

#licensesTable thead th:last-child {
    border-top-right-radius: 8px;
}

/* Sorting indicators */
#licensesTable thead th.sorting:after,
#licensesTable thead th.sorting_asc:after,
#licensesTable thead th.sorting_desc:after {
    opacity: 0.5;
    margin-left: 8px;
}

#licensesTable thead th.sorting_asc:after,
#licensesTable thead th.sorting_desc:after {
    opacity: 1;
}

/* Striped rows */
#licensesTable tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* Checkbox styling in table */
#licensesTable .select-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* License key monospace styling */
#licensesTable .license-key {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

/* Responsive table improvements */
@media (max-width: 768px) {
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin: 10px 0;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        text-align: left;
        margin-bottom: 10px;
    }
}

/* Badge animations and improvements */
.badge {
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.badge-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.badge-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.badge-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
    color: #212529;
}

.badge-primary {
    background: linear-gradient(135deg, #007bff 0%, #6610f2 100%);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.badge-info {
    background: linear-gradient(135deg, #17a2b8 0%, #3498db 100%);
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

/* Expired date highlight */
.text-danger {
    font-weight: 600;
}

/* Copy button improvements */
.copy-license-key {
    transition: all 0.2s;
}

.copy-license-key:hover {
    transform: scale(1.1);
}

.copy-license-key:active {
    transform: scale(0.95);
}

/* Bulk actions toolbar animation */
#bulkActionsToolbar {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading spinner for DataTables */
.dataTables_processing {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}