/* Global styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensure body takes full viewport height */
}

/* Header styles */
header {
    background-color: #007bff;
    color: white;
    padding: 20px;
    text-align: center;
}

header h1 {
    margin: 0;
}

header p {
    margin: 10px 0 0;
    font-size: 18px;
    line-height: 1.5;
}

/* Ad placement styles */
.ads-container {
    display: flex;
    flex-direction: row; /* Default to horizontal layout */
    margin: 20px 0;
    flex: 1;
    height: 100%; /* Ensure the container takes full height */
}

.ad-sidebar {
    width: 100%;
    max-width: 300px;
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 10px;
    /* Hide on mobile */
    display: block;
    flex: 1; /* Allow sidebar to grow and fill available height */
    height: 100%; /* Full height of parent container */
}

/* Main container */
.main-container {
    flex: 1; /* Allow main-container to grow and fill available space */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align items to the top */
    padding: 20px;
    flex-direction: column;
    height: 100%; /* Ensure it takes full height of the parent */
}

/* Container for content */
.container {
    max-width: 800px;
    width: 100%;
    padding: 20px;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin: 0 auto; /* Center the container horizontally */
}

/* Form and buttons styles */
form {
    display: flex;
    flex-direction: column;
}

.form-section {
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

input[type="file"] {
    display: block;
    margin-bottom: 10px;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 16px;
    margin-right: 10px;
    display: inline-block;
}

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

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.form-actions {
    margin-top: 20px;
    text-align: right;
}

/* Loading spinner styles */
.loading {
    display: none; /* Initially hidden */
    position: fixed; /* Fixed position */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    text-align: center;
    z-index: 1000; /* Ensure it appears above other content */
    padding-top: 20%; /* Adjust as needed to center vertically */
}

.spinner {
    border: 8px solid #f3f3f3; /* Light grey */
    border-top: 8px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    display: inline-block; /* Center the spinner */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Table styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th, table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

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

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

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

/* Responsive adjustments for mobile screens */
@media (max-width: 600px) {
    .ads-container {
        flex-direction: column; /* Stack ads vertically if necessary */
        margin: 0; /* Remove margin */
    }

    .ad-sidebar {
        display: none; /* Hide sidebars on mobile */
    }

    .main-container {
        width: 100%; /* Ensure it takes full width */
        padding: 10px; /* Reduce padding for smaller screens */
    }

    .container {
        padding: 10px; /* Reduce padding */
    }

    textarea {
        font-size: 14px;
        padding: 8px;
    }

    button {
        font-size: 14px;
        padding: 8px;
    }

    .form-section {
        margin-bottom: 15px;
    }
}

/* Ensure images and videos scale properly */
img, video {
    max-width: 100%;
    height: auto;
}

/* Improve readability on small screens */
body {
    font-size: 16px;
}
