/* Mobile-first base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* Layout container */
.layout-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Header styles */
.header {
    background-color: #007bff;
    color: #fff;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 900;
}

/* Sidebar styles */
.sidebar {
    background-color: #2c3e50;
    color: #fff;
    width: 250px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: -250px;
    transition: left 0.3s ease;
    z-index: 1000;
}

.sidebar.open {
    left: 0;
}

.sidebar-toggle {
    display: block;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem;
}

.sidebar-menu li {
    margin: 0.5rem 0;
}

.sidebar-menu a {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: #34495e;
}

/* Main content */
.main-content {
    flex: 1;
    padding: 1rem;
    margin-top: 60px; /* Height of header */
    margin-left: 0;
    width: 100%;
}

/* Dashboard analytics */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.analytics-card {
    background-color: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.analytics-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.analytics-card p {
    font-size: 1.5rem;
    color: #007bff;
}

/* Clients page styles */
.clients-container {
    background-color: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    width: 100%;
}

.clients-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.clients-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    table-layout: fixed;
}

.clients-table th,
.clients-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
    border: 1px solid #e9ecef;
}

.clients-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.clients-table tr:hover {
    background-color: #f1f1f1;
}

.clients-table .action-buttons a,
.clients-table .action-buttons button {
    padding: 0.5rem;
    margin-right: 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.clients-table .action-edit {
    background-color: #007bff;
    color: #fff;
}

.clients-table .action-edit:hover {
    background-color: #0056b3;
}

.clients-table .action-suspend {
    background-color: #dc3545;
    color: #fff;
}

.clients-table .action-suspend:hover {
    background-color: #b02a37;
}

.clients-table .action-activate {
    background-color: #28a745;
    color: #fff;
}

.clients-table .action-activate:hover {
    background-color: #218838;
}

/* Reusable container for auth pages */
.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 1rem auto;
}

/* Reusable form styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Reusable input group */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 0.75rem;
    color: #666;
    font-size: 1.1rem;
}

/* Reusable input styles */
.auth-input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.auth-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

/* Reusable button styles */
.auth-button {
    background-color: #007bff;
    color: #fff;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.auth-button:hover {
    background-color: #0056b3;
}

/* Reusable heading styles */
.auth-heading {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: #333;
}

/* Reusable link styles */
.auth-link {
    text-align: center;
    color: #007bff;
    text-decoration: none;
    font-size: 0.9rem;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Error message styles */
.error-message {
    color: #dc3545;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 1rem;
}

/* Success message styles */
.success-message {
    color: #28a745;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 1rem;
}

/* Table styles for dashboard and clients */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    font-weight: bold;
}

tr:hover {
    background-color: #f1f1f1;
}

/* Style for API key display */
.api-key {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    word-break: break-all;
    display: inline-block;
    max-width: 100%;
}

/* Style for copy button */
.copy-button {
    margin-left: 8px;
    padding: 4px 8px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.copy-button:hover {
    background-color: #0056b3;
}

/* Style for code blocks */
.code-block {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Style for inline code */
.code-inline {
    background-color: #f1f3f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

/* Style for lists */
.list-styled {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

/* Heading styles for hierarchy */
.main-content h2 {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.main-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.main-content h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.main-content h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Media queries for larger screens */
@media (min-width: 768px) {
    .layout-container {
        flex-direction: row;
    }

    .header {
        width: calc(100% - 250px);
        left: 250px;
        padding: 1.5rem;
    }

    .header-title {
        font-size: 1.5rem;
    }

    .header-user {
        font-size: 1rem;
    }

    .sidebar {
        left: 0;
    }

    .sidebar-toggle {
        display: none;
    }

    .main-content {
        margin-left: 250px;
        width: calc(100% - 250px);
        padding: 2rem;
    }

    .analytics-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .clients-container {
        padding: 2rem;
        width: 100%;
    }

    .auth-container {
        padding: 2rem;
    }

    .auth-heading {
        font-size: 1.8rem;
    }

    .auth-button {
        padding: 1rem;
    }

    .api-key {
        max-width: 100%;
        font-size: 0.95rem;
    }

    .copy-button {
        padding: 6px 10px;
        font-size: 0.95rem;
    }

    .clients-table th,
    .clients-table td {
        padding: 0.75rem;
    }
}

/* Responsive design for smaller elements */
@media (max-width: 768px) {
    .code-block {
        font-size: 0.85rem;
        padding: 0.75rem;
    }

    .api-key {
        max-width: 100%;
        font-size: 0.85rem;
    }

    .copy-button {
        padding: 2px 6px;
        font-size: 0.85rem;
    }

    .clients-table {
        overflow-x: auto;
    }

    .clients-table th,
    .clients-table td {
        padding: 0.5rem;
    }
}