/* Custom CSS for License Management Admin */

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

/* Animated background circles */
.login-page::before,
.login-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 20s infinite ease-in-out;
}

.login-page::before {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.login-page::after {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: -50px;
    animation-delay: 5s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) rotate(180deg);
    }
}

.login-box {
    width: 400px;
    position: relative;
    z-index: 1;
}

.login-logo {
    margin-bottom: 25px;
    text-align: center;
    animation: slideDown 0.6s ease-out;
}

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

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

.login-logo a {
    color: #fff;
    font-weight: bold;
    font-size: 2.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-logo a::before {
    content: '🔐';
    font-size: 3rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.login-card-body {
    border-radius: 15px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    padding: 30px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.login-box-msg {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

/* Enhanced input styling */
.login-card-body .input-group {
    margin-bottom: 20px;
    position: relative;
}

.login-card-body .form-control {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-card-body .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    transform: translateY(-2px);
}

.login-card-body .input-group-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    border-radius: 0 10px 10px 0;
    padding: 0 15px;
}

.login-card-body .input-group-text .fas {
    font-size: 1.2rem;
}

/* Enhanced button */
.login-card-body .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.login-card-body .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.login-card-body .btn-primary:active {
    transform: translateY(-1px);
}

/* Alert styling */
.login-card-body .alert {
    border-radius: 10px;
    border: none;
    animation: shake 0.5s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* License Key Display */
.key-field {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background-color: #f4f6f9;
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    word-break: break-all;
    display: inline-block;
    max-width: 300px;
}

/* Status Badges */
.badge-active {
    background-color: #28a745;
}

.badge-inactive {
    background-color: #6c757d;
}

.badge-suspended {
    background-color: #ffc107;
}

.badge-expired {
    background-color: #dc3545;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #007bff !important;
    border-color: #007bff !important;
    color: white !important;
}

/* Modal Customization */
.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header .close {
    color: white;
    opacity: 0.8;
}

.modal-header .close:hover {
    opacity: 1;
}

/* Statistics Cards */
.info-box {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.info-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

/* Action Buttons */
.btn-action {
    margin: 2px;
}

/* Quick Action Cards */
.card.card-outline .card-body.box-profile {
    padding: 20px;
}

.card.card-outline .card-body.box-profile .fa-3x {
    color: #6c757d;
}

/* ========== RESPONSIVE STYLES ========== */

/* Tablet and below (768px) */
@media (max-width: 768px) {

    /* Login Box */
    .login-box {
        width: 90%;
        margin: 10px auto;
    }

    .login-logo a {
        font-size: 2rem;
    }

    .login-logo a::before {
        font-size: 2.5rem;
    }

    .login-card-body {
        padding: 25px;
    }

    .login-box-msg {
        font-size: 1rem;
    }

    /* Sidebar */
    .main-sidebar {
        margin-left: -250px;
    }

    .sidebar-open .main-sidebar {
        margin-left: 0;
    }

    /* Content */
    .content-wrapper {
        margin-left: 0 !important;
    }

    /* Statistics Cards - Stack on mobile */
    .info-box {
        margin-bottom: 15px;
    }

    .info-box-icon {
        width: 70px;
    }

    .info-box-number {
        font-size: 1.5rem;
    }

    /* Tables */
    .key-field {
        max-width: 120px;
        font-size: 0.7rem;
        padding: 3px 5px;
    }

    .table {
        font-size: 0.85rem;
    }

    .table th,
    .table td {
        padding: 0.5rem;
        vertical-align: middle;
    }

    /* Action Buttons - Keep inline but smaller */
    .btn-action {
        display: inline-block;
        width: auto;
        margin: 2px;
        padding: 0.25rem 0.5rem;
    }

    .btn-action i {
        font-size: 0.9rem;
    }

    /* Table responsive wrapper */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Card Headers */
    .card-title {
        font-size: 1rem;
    }

    /* Modals */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    /* Quick Action Cards */
    .card.card-outline {
        margin-bottom: 15px;
    }

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

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center;
        margin-top: 10px;
    }
}

/* Mobile phones (576px and below) */
@media (max-width: 576px) {

    /* Login */
    .login-box {
        width: 95%;
        padding: 0 10px;
    }

    .login-logo {
        margin-bottom: 20px;
    }

    .login-logo a {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 5px;
    }

    .login-logo a::before {
        font-size: 3.5rem;
    }

    .login-card-body {
        padding: 20px 15px;
        border-radius: 20px;
    }

    .login-box-msg {
        font-size: 0.95rem;
        margin-bottom: 15px;
    }

    .login-card-body .form-control {
        font-size: 0.95rem;
        padding: 10px 12px;
    }

    .login-card-body .btn-primary {
        font-size: 1rem;
        padding: 10px;
    }

    /* Make background circles smaller on mobile */
    .login-page::before {
        width: 200px;
        height: 200px;
    }

    .login-page::after {
        width: 150px;
        height: 150px;
    }

    /* Header */
    .main-header .navbar-nav .nav-link {
        padding: 0.5rem;
    }

    /* Statistics Cards - Full width */
    .col-lg-3.col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .info-box {
        display: flex;
        margin-bottom: 10px;
    }

    .info-box-icon {
        width: 60px;
        height: 60px;
        line-height: 60px;
    }

    .info-box-icon i {
        font-size: 1.5rem;
    }

    .info-box-text {
        font-size: 0.85rem;
    }

    .info-box-number {
        font-size: 1.3rem;
    }

    /* Tables - More compact */
    .table {
        font-size: 0.75rem;
    }

    .table th,
    .table td {
        padding: 0.4rem 0.3rem;
        white-space: nowrap;
    }

    /* Make action column wider for buttons */
    .table td:last-child {
        min-width: 100px;
        white-space: normal;
    }

    .key-field {
        max-width: 100px;
        font-size: 0.65rem;
    }

    /* Buttons - Keep inline, make smaller */
    .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }

    .btn-action {
        display: inline-block;
        width: auto;
        margin: 1px;
        padding: 0.2rem 0.35rem;
    }

    .btn-action i {
        font-size: 0.75rem;
        margin: 0;
    }

    /* Hide button text, show only icons on very small screens */
    .btn-action .btn-text {
        display: none;
    }

    /* Card Tools */
    .card-tools .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }

    /* Modals - Full screen on mobile */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }

    .modal-content {
        height: 100%;
        border-radius: 0;
    }

    .modal-body {
        overflow-y: auto;
    }

    /* Form Groups */
    .form-group label {
        font-size: 0.9rem;
    }

    .form-control {
        font-size: 0.9rem;
    }

    /* Quick Action Cards - Full width */
    .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Recent Licenses Table */
    #section-dashboard .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Hide less important columns on mobile */
    .table-responsive-mobile th:nth-child(n+4),
    .table-responsive-mobile td:nth-child(n+4) {
        display: none;
    }
}

/* Very small devices (400px and below) */
@media (max-width: 400px) {
    .info-box-text {
        font-size: 0.75rem;
    }

    .info-box-number {
        font-size: 1.1rem;
    }

    .card-title {
        font-size: 0.9rem;
    }

    .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* SweetAlert2 Custom Styling */
.swal2-popup {
    border-radius: 10px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}