/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
}

/* Header */
header {
    background-color: #2563eb; /* Updated to main color */
    color: #fff;
    padding: 0; /* No padding needed */
    text-align: center; /* Center text horizontally */
    width: 100%; /* Ensure the header spans the full width */
    position: fixed; /* Fix the header at the top */
    top: 0; /* Position at the top */
    left: 0; /* Align to the left */
    z-index: 1000; /* Ensure it stays above other content */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Add a subtle shadow */
    height: 50px; /* Set a fixed height for the header */
    display: flex;
    align-items: center;
    justify-content: center;
}

header h1 {
    margin: 0; /* Remove default margin */
    font-size: 1.5rem; /* Reduced font size for a smaller header */
    line-height: 50px; /* Center the text vertically */
}

/* Navigation */
nav {
    display: none; /* Hide the navigation menu */
}

/* Sidebar */
aside {
    background-color: #666466; /* Updated to the new color */
    color: #fff; /* Keep text color white for contrast */
    padding: 1rem;
    width: 200px;
    position: fixed;
    top: 50px; /* Match the new height of the header */
    left: 0;
    height: calc(100% - 50px); /* Adjust height to account for the header */
    overflow-y: auto;
    z-index: 999; /* Ensure it stays below the header */
}

aside h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

aside ul {
    list-style: none;
}

aside ul li {
    margin: 0.5rem 0;
}

aside ul li a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem;
    display: block;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

aside ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Subtle hover effect */
}

/* Main Content */
main {
    margin-left: 220px; /* Adjust for sidebar */
    padding: 2rem;
    padding-top: 6rem; /* Add extra padding at the top to avoid header overlap */
}

//* Template Editor Layout */
.template-editor {
    margin-top: 2rem;
    width: 95%; /* Almost full width of the page */
    margin-left: auto;
    margin-right: auto;
}

.editor-container {
    display: flex;
    gap: 1rem; /* Space between editor and preview */
    width: 100%; /* Ensure the container takes up full width */
}

.editor, .preview {
    flex: 1; /* Equal width for both editor and preview */
    min-width: 0; /* Prevent flex items from overflowing */
}

.editor textarea {
    width: 100%;
    height: 600px; /* Increased height for better usability */
    font-family: monospace;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    resize: vertical; /* Allow vertical resizing */
}

.preview iframe {
    width: 100%;
    height: 600px; /* Match the height of the textarea */
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .editor-container {
        flex-direction: column; /* Stack editor and preview vertically */
    }

    .editor textarea, .preview iframe {
        height: 300px; /* Reduce height for smaller screens */
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .editor-container {
        flex-direction: column; /* Stack editor and preview vertically */
    }

    .editor textarea, .preview iframe {
        height: 300px; /* Reduce height for smaller screens */
    }
}

/* Forms */
form {
    background-color: #fff;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: 2rem auto;
}

form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form textarea,
form select {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

form button {
    background-color: #2563eb; /* Updated to main color */
    color: #fff;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

form button:hover {
    background-color: #1e4bb5; /* Darker shade of main color */
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

table th,
table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #2563eb; /* Updated to main color */
    color: #fff;
}

table tr:hover {
    background-color: #f5f5f5;
}

/* Buttons */
.button {
    background-color: #2563eb; /* Updated to main color */
    color: #fff;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.button:hover {
    background-color: #1e4bb5; /* Darker shade of main color */
}

/* Delete Button */
button[type="submit"] {
    background-color: #ff4444;
}

button[type="submit"]:hover {
    background-color: #cc0000;
}

/* Stats Container */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns */
    grid-template-rows: repeat(2, auto); /* 2 rows */
    gap: 1rem; /* Space between cards */
    margin-top: 2rem;
}

/* Stat Card Colors (Pastel) */
.stat-card.total-users {
    background-color: #a3d8f4; /* Soft Blue */
}

.stat-card.total-messages {
    background-color: #b2f2bb; /* Soft Green */
}

.stat-card.total-templates {
    background-color: #ffd8b2; /* Soft Orange */
}

.stat-card.total-contacts {
    background-color: #d4b9da; /* Soft Purple */
}

.stat-card.active-users {
    background-color: #b2e2e2; /* Soft Cyan */
}

.stat-card.suspended-users {
    background-color: #ffb3ba; /* Soft Red */
}

.stat-card.sent-messages {
    background-color: #c8e6c9; /* Soft Light Green */
}

.stat-card.scheduled-messages {
    background-color: #fff3b2; /* Soft Yellow */
}

/* Stat Card General Styles */
.stat-card {
    padding: 1.5rem;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%; /* Ensure cards take up full grid cell */
    color: #333; /* Darker text for better contrast with pastel backgrounds */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth transition for hover effect */
}

.stat-card:hover {
    transform: translateY(-5px); /* Slight lift on hover */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* Enhanced shadow on hover */
}

.stat-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.stat-card p {
    font-size: 2rem;
    font-weight: bold;
}

/* Footer */
footer {
    background-color: #f4f4f4; /* Light grey background */
    color: #333; /* Darker text color for better contrast */
    text-align: center; /* Center-align the text */
    padding: 0.5rem 0; /* Reduced padding to make it smaller */
    position: fixed; /* Fix the footer to the bottom */
    bottom: 0; /* Position at the bottom */
    left: 0; /* Align to the left */
    width: 100%; /* Full width */
    z-index: 1000; /* Ensure it stays above other content */
    font-size: 0.875rem; /* Smaller font size */
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1); /* Add a subtle shadow */
    border-top: 1px solid #ddd; /* Add a subtle border at the top */
}

footer p {
    margin: 0;
}

/* Icon Buttons */
.icon-button {
    display: inline-block;
    padding: 6px; /* Smaller padding for smaller icons */
    border-radius: 5px;
    text-align: center;
    transition: background-color 0.3s ease;
    text-decoration: none; /* Remove underline */
    color: #fff; /* Default icon color */
}

.icon-button:hover {
    opacity: 0.8; /* Slight fade on hover */
}

.icon-button i {
    font-size: 0.875rem; /* Smaller icons */
}

/* Edit Button */
.edit-button {
    background-color: #2563eb; /* Blue for edit */
}

.edit-button:hover {
    background-color: #1e4bb5; /* Darker blue on hover */
}

/* Delete Button */
.delete-button {
    background-color: #ff4444; /* Red for delete */
}

.delete-button:hover {
    background-color: #cc0000; /* Darker red on hover */
}

/* Suspend Button */
.suspend-button {
    background-color: #ffa500; /* Orange for suspend */
}

.suspend-button:hover {
    background-color: #cc8400; /* Darker orange on hover */
}

/* Responsive Design */
@media (max-width: 1200px) {
    .stats {
        grid-template-columns: repeat(3, 1fr); /* 3 columns for medium screens */
    }
}

@media (max-width: 768px) {
    .stats {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for small screens */
    }

    main {
        margin-left: 0; /* Remove sidebar margin on small screens */
        padding-top: 8rem; /* Adjust padding for header */
    }

    aside {
        width: 100%; /* Full width sidebar on small screens */
        height: auto; /* Auto height */
        position: static; /* Remove fixed positioning */
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr; /* 1 column for mobile screens */
    }

    header h1 {
        font-size: 1.25rem; /* Smaller font size for mobile */
    }

    .stat-card h3 {
        font-size: 1rem; /* Smaller font size for mobile */
    }

    .stat-card p {
        font-size: 1.5rem; /* Smaller font size for mobile */
    }
}

/* Template Form Styles */
.template-form {
    background-color: #fff;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: 95%; /* Almost full width of the page */
    margin: 2rem auto;
}

.template-form .editor-container {
    display: flex;
    gap: 1rem; /* Space between editor and preview */
    width: 100%; /* Ensure the container takes up full width */
}

.template-form .editor, .template-form .preview {
    flex: 1; /* Equal width for both editor and preview */
    min-width: 0; /* Prevent flex items from overflowing */
}

.template-form .editor textarea {
    width: 100%;
    height: 550px; /* Reduced height by 50px (from 600px to 550px) */
    font-family: monospace;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    resize: vertical; /* Allow vertical resizing */
}

.template-form .preview iframe {
    width: 100%;
    height: 550px; /* Reduced height by 50px (from 600px to 550px) */
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .template-form .editor-container {
        flex-direction: column; /* Stack editor and preview vertically */
    }

    .template-form .editor textarea, .template-form .preview iframe {
        height: 250px; /* Reduced height by 50px (from 300px to 250px) */
    }
}

/* Icon buttons */
.icon-button {
    background: none;
    border: none;
    color: #2563eb;
    font-size: 18px;
    cursor: pointer;
    margin: 0 5px;
    text-decoration: none;
}

.icon-button:hover {
    color: #1e4bb5;
}

.icon-button i {
    vertical-align: middle;
}

/* Search Bar */
.search-bar {
    margin-bottom: 20px;
    text-align: right;
}

.search-bar input {
    width: 300px; /* Adjust width as needed */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

/* Icon buttons */
.icon-button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    margin: 0 5px;
    text-decoration: none;
}

.icon-button.send-button {
    color: #28a745; /* Green for send message */
}

.icon-button.edit-button {
    color: #2563eb; /* Blue for edit */
}

.icon-button.delete-button {
    color: #dc3545; /* Red for delete */
}

.icon-button:hover {
    opacity: 0.8;
}

/* Icon buttons */
.icon-button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    margin: 0 5px;
    text-decoration: none;
}

.icon-button.edit-button {
    color: #2563eb; /* Blue for edit */
}

.icon-button.delete-button {
    color: #dc3545; /* Red for delete */
}

.icon-button:hover {
    opacity: 0.8;
}

/* Style for the datetime input field */
input[type="datetime-local"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    background-color: #fff;
    color: #333;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* WebKit-specific styles for the datetime input field */
input[type="datetime-local"]::-webkit-datetime-edit {
    color: #333;
    padding: 5px;
}

input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper {
    background-color: #fff;
}

input[type="datetime-local"]::-webkit-datetime-edit-text {
    color: #333;
    padding: 0 5px;
}

input[type="datetime-local"]::-webkit-datetime-edit-month-field,
input[type="datetime-local"]::-webkit-datetime-edit-day-field,
input[type="datetime-local"]::-webkit-datetime-edit-year-field,
input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
input[type="datetime-local"]::-webkit-datetime-edit-minute-field,
input[type="datetime-local"]::-webkit-datetime-edit-second-field,
input[type="datetime-local"]::-webkit-datetime-edit-ampm-field {
    color: #333;
    background-color: #fff;
    padding: 0 5px;
}

input[type="datetime-local"]::-webkit-inner-spin-button,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(0.5); /* Adjust the color of the calendar icon */
    cursor: pointer;
}

/* Hover and focus states */
input[type="datetime-local"]:hover {
    border-color: #2563eb;
}

input[type="datetime-local"]:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 5px rgba(37, 99, 235, 0.5);
}

/* Spacing above the button */
.button-spacing {
    margin-top: 20px; /* Adjust this value to match the spacing on other pages */
}

/* Form styling */
form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

form input[type="text"],
form textarea,
form select,
form input[type="datetime-local"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

form textarea {
    resize: vertical;
    min-height: 150px;
}

form button {
    background-color: #2563eb;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

form button:hover {
    background-color: #1e4bb5;
}

//* Back button */
.back-button {
    display: inline-block;
    margin-bottom: 20px;
    background-color: #6c757d; /* Gray color */
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
}

.back-button:hover {
    background-color: #5a6268; /* Darker gray on hover */
    opacity: 0.9;
}

.back-button i {
    margin-right: 8px; /* Space between icon and text */
}

.messages-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.messages-table th, .messages-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.messages-table th {
    background-color: #3268ea;
}

.actions a {
    margin-right: 10px;
    text-decoration: none;
}

.actions a:hover {
    opacity: 0.8;
}

.actions i {
    font-size: 18px;
}

/* Status badge styling */
.status-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
}

.status-unverified {
    background-color: #f59e0b; /* Orange */
}

.status-pending {
    background-color: #2563eb; /* Blue */
}

.status-sent {
    background-color: #16a34a; /* Green */
}

.status-verified {
    background-color: #9333ea; /* Purple */
}

.status-failed {
    background-color: #dc2626; /* Red */
}