/* 
 * enhanced.css - Shared styles for i5o URL Shortener
 * Created as part of UI modernization project
 */

/* CSS Variables */
:root {
    --primary: #004aad;
    --primary-light: #1e90ff;
    --primary-dark: #003c8f;
    --secondary: #00d4ff;
    --accent: #ff6b6b;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    --dark: #343a40;
    --gray: #6c757d;
    --light: #f8f9fa;
    --white: #ffffff;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --border-radius: 10px;
    --transition: all 0.3s ease;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    line-height: 1.6;
    background-color: #f4f7fc;
    overflow-x: hidden;
}

[dir="rtl"] * {
    font-family: 'Cairo', sans-serif;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-light);
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--dark);
}

.btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-warning {
    background-color: var(--warning);
    color: var(--dark);
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-white {
    background-color: var(--white);
    color: var(--primary);
}

.btn-white:hover {
    background-color: var(--light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-white {
    background-color: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}

.btn-outline-white:hover {
    background-color: var(--white);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0,0,0,0.05);
    color: var(--gray);
    transition: var(--transition);
}

.btn-icon:hover {
    background-color: var(--primary-light);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.2);
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.input-icon-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
}

.input-icon:hover {
    color: var(--primary);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
}

.card-title-icon {
    margin-right: 10px;
    color: var(--primary);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background-color: var(--light);
    font-weight: 600;
    text-align: left;
    padding: 1rem;
    color: var(--dark);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover {
    background-color: rgba(0,0,0,0.02);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.truncate {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Header */
.header {
    background: var(--gradient);
    color: var(--white);
    box-shadow: var(--shadow-md);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    color: var(--white);
    margin-left: 1.5rem;
    font-weight: 500;
    opacity: 0.9;
}

.nav-links a:hover {
    opacity: 1;
}

[dir="rtl"] .nav-links a {
    margin-right: 1.5rem;
    margin-left: 0;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 500px;
    animation: modal-fade 0.3s;
}

@keyframes modal-fade {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Error and Success Messages */
.error-message {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger);
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message i {
    font-size: 1rem;
}

.success-message {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success);
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Footer */
.footer {
    background-color: #001f3f;
    color: var(--white);
    padding: 5rem 0 2rem;
    position: relative;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-logo i {
    font-size: 1.5rem;
}

.footer-about p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
}

.footer-heading {
    font-size: 1.2rem;
    color: var(--white);
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--primary-light);
}

[dir="rtl"] .footer-heading::after {
    right: 0;
    left: auto;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--white);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-radius: 50%;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-light);
    color: var(--white);
    transform: translateY(-3px);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Utilities */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.divider hr {
    flex: 1;
    border: none;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
}

.divider span {
    color: var(--gray);
    font-size: 0.85rem;
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.5s ease forwards;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Dashboard specific */
.sidebar {
    width: 260px;
    background: var(--white);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    transition: var(--transition);
    z-index: 10;
}

.sidebar-collapsed {
    width: 80px;
}

.nav-menu {
    list-style: none;
    margin-top: 1rem;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius);
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(0, 74, 173, 0.1);
    color: var(--primary);
}

.nav-icon {
    font-size: 1.2rem;
    margin-right: 10px;
    width: 24px;
    text-align: center;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.5rem;
}

.primary-icon {
    background-color: rgba(0, 74, 173, 0.1);
    color: var(--primary);
}

.success-icon {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.warning-icon {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--warning);
}

.info-icon {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--info);
}

.stat-info {
    flex: 1;
}

.stat-title {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 0.3rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--dark);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--dark);
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.pagination a:hover {
    background-color: var(--light);
}

.pagination a.active {
    background-color: var(--primary);
    color: white;
}

/* Auth pages specific */
.auth-container {
    background: var(--white);
    width: 100%;
    max-width: 440px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    position: relative;
    z-index: 1;
}

.auth-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--gradient);
    position: relative;
    overflow: hidden;
}

.auth-body::before, .auth-body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    z-index: 0;
}

.auth-body::before {
    top: -5rem;
    right: -5rem;
    width: 20rem;
    height: 20rem;
}

.auth-body::after {
    bottom: -5rem;
    left: -5rem;
    width: 15rem;
    height: 15rem;
}

/* Hero section */
.hero {
    padding: 9rem 0 5rem;
    background-color: var(--primary);
    background-image: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%),
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    bottom: -5rem;
    right: -5rem;
    width: 20rem;
    height: 20rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    top: -5rem;
    left: -5rem;
    width: 15rem;
    height: 15rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--white);
    position: relative;
    z-index: 1;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    opacity: 0.9;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

/* URL Form */
.url-form {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    position: relative;
    z-index: 5;
}

/* Main Content - Dashboard */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    transition: var(--transition);
}

.main-collapsed {
    margin-left: 80px;
}

/* Media Queries */
@media (max-width: 992px) {
    .sidebar {
        width: 80px;
    }
    
    .sidebar .logo-text,
    .sidebar .nav-text,
    .sidebar .user-info {
        display: none;
    }
    
    .main-content {
        margin-left: 80px;
    }
    
    .toggle-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
        gap: 1rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block;
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
    }

    .stats-grid, 
    .features-grid, 
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .action-buttons {
        width: 100%;
    }
    
    .btn {
        flex: 1;
        justify-content: center;
    }
    
    .input-group {
        flex-direction: column;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 576px) {
    .sidebar {
        position: fixed;
        width: 260px;
        left: -260px;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .sidebar .logo-text,
    .sidebar .nav-text,
    .sidebar .user-info {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .auth-container {
        padding: 2rem;
    }
    
    .cta-buttons,
    .steps {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
}