:root {
    --branding-black:#051126;
    --branding-dark-blue: #0C2248;
    --branding-green:#23D675;
    --branding-blue: #9ADBFF;
    --color-white: #ffff;
}

body {
    margin: 0;
    font-family: "Poppins", sans-serif;
    font-style: normal;
}
header {
    background: var(--branding-dark-blue);
    padding: 50px 0;
}
.container {
    max-width: 80%;
    display: block;
    margin-inline: auto;
    overflow-x: auto;
    padding: 20px 0;
}
@media(max-width: 1920px){
    .container{
        max-width: 95%;
    }
}


.color-action{
    color: var(--branding-green);
}

nav {
    display: flex;
    gap: 40px;
    justify-content: center;
}
nav a {
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}
nav a:last-child{
    color: #B23B3B;
    margin-left: auto;
}
h1 {
    text-align: center;
}

.inputs-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}
.inputs-wrapper input, .search-box input {
    width: 500px;
    margin: 0;
    padding: 10px;
    border-radius: 15px;
    border: 1px solid var(--branding-dark-blue);
}
.submit {
    text-align: center;
}
.submit button {
    margin-top: 20px;
    cursor: pointer;
    width: 300px;
    padding: 10px;
    border-radius: 15px;
    background: var(--branding-green);
    color: #fff;
    border: 1px solid var(--branding-green);
}

.flashes {
    list-style: none;
}
.flashes li {
    text-align: center;
}
.flashes li.message-fail {
    padding: 20px;
    border: 4px solid red;
    max-width: 80%;
    display: block;
    margin: auto;
    border-radius: 14px;
}
.flashes li.success, .flashes li.message-success{
    padding: 20px;
    border: 4px solid var(--branding-green);
    max-width: 80%;
    display: block;
    margin: auto;
    border-radius: 14px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    border-radius: 14px;
    overflow: hidden;
    min-width: 800px;
    table-layout: fixed;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 10px;
    text-align: center;
}

th {
    background-color: #f2f2f2;
}

tr:nth-child(odd) {
    background-color: #f9f9f9;
}

tr:nth-child(even) {
    background-color: #fff;
}

th:nth-child(1) {
    width: 20%;
}

th:nth-child(2) {
    width: 15%;
}

th:nth-child(3) {
    width: 10%;
}

th:nth-child(4) {
    width: 3%;
}

th:nth-child(5) {
    width: 10%;
}

th:nth-child(6) {
    width: 5%;
}
th:nth-child(7) {
    width: 15%;
}

td {
    vertical-align: middle;
    white-space: nowrap;
}

.btn-del{
    background: red;
    border-radius:5px;
    border: 1px solid red;
    color: #fff;
    padding: 5px 10px;
    cursor: pointer;
}
.btn-details {
    background: var(--branding-green);
    border: 1px solid var(--branding-green);
    cursor: pointer;

}
table a {
    color: black;
}

.form-sort {
    text-align: right;
}

.form-sort select{
    border-radius:5px;
    padding: 5px;
}
#searchInput {
    text-align: center;
}

.details-content {
    max-width: 95%;
    margin: 10px auto;
    overflow-x: auto;
}

.details-content table {
    table-layout: auto;
    min-width: 1000px;
    margin: 0;
}

.details-content th {
    background-color: var(--branding-dark-blue);
    color: white;
    font-size: 0.9em;
    padding: 8px;
    white-space: nowrap;
}

.details-content td {
    font-size: 0.9em;
    padding: 8px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.details-content th:nth-child(1) {
    width: 10%;
}

.details-content th:nth-child(2) {
    width: 10%;
}

.details-content th:nth-child(3) {
    width: 20%;
}

.details-content th:nth-child(4) {
    width: 25%;
}

.details-content th:nth-child(5) {
    width: 10%;
}

.details-content th:nth-child(6) {
    width: 10%;
}

.details-content th:nth-child(7) {
    width: 10%;
}

.details-content th:nth-child(8) {
    width: 5%;
}

.details-content tr:hover {
    background-color: #f5f5f5;
}

.details-content::-webkit-scrollbar {
    height: 6px;
}

.details-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.details-content::-webkit-scrollbar-thumb {
    background: var(--branding-dark-blue);
    border-radius: 3px;
}

.details-content::-webkit-scrollbar-thumb:hover {
    background: var(--branding-green);
}

tr[id^="details-"] td {
    padding: 10px 0;
    background-color: #f8f9fa;
}

.details-content table {
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.copy-btn {
    background: var(--branding-dark-blue);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: var(--branding-green);
    transform: scale(1.1);
    transition: all 0.2s ease;
}

.url-cell {
    gap: 8px;
    padding: 5px;
    min-height: 40px;
    overflow-x: auto;
}

.url-cell > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.url-text {
    max-width: calc(100% - 40px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.copy-tooltip {
    position: relative;
    display: inline-block;
}

.copy-tooltip::after {
    content: "Copied!";
    position: absolute;
    left: 50%;
    top: 0px;
    transform: translateX(-50%);
    background: var(--branding-green);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
    z-index: 1000;
}

.copy-tooltip.show::after {
    opacity: 1;
}

.actions-cell {
    min-width: 220px;
}

.actions-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    padding: 4px 0;
}

.action-row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.action-row form {
    margin: 0;
}
.action-row img, .action-row .url-owner-avatar {
    margin-right: 15px;

}
/* Update button widths to be consistent */
.btn-details, .btn-del, .btn-download {
    min-width: 80px;
    padding: 4px 8px;
    font-size: 12px;
}

.url-owner {
    display: flex;
    align-items: center;
}

.url-owner-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--branding-dark-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Hide scrollbar but keep functionality */
.url-cell::-webkit-scrollbar {
    display: none;
}

.url-cell {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Add styles for campaign cell */
td:nth-child(5) { /* Campaign column */
    max-width: 0; /* Required for text-overflow to work with table-layout: fixed */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Add a title attribute to show full campaign name on hover */
.campaign-cell {
    position: relative;
}

.campaign-cell:hover::after {
    content: attr(data-campaign);
    position: absolute;
    left: 50%;
    top: -30px;
    transform: translateX(-50%);
    background: var(--branding-dark-blue);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

.google-login {
    margin-top: 20px;
    text-align: center;
}

.google-btn {
    display: inline-flex;
    align-items: center;
    background: #fff;
    color: #757575;
    padding: 12px 24px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.3s;
}

.google-btn:hover {
    background-color: #f5f5f5;
}

.google-btn i {
    margin-right: 10px;
    color: #4285f4;
}

/* Login page specific styles */
.main-conent.container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
}

.oauth-container input{
    width:280px;
}
.google-login {
    margin-top: 20px;
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 20px;

}

.google-btn {
    display: flex;
    justify-content: center;
    gap: 30px;
    background: #fff;
    color: #757575;
    padding: 12px 0px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.3s;
    max-width: 80%;
    margin: 0 auto;
}

.google-btn:hover {
    background-color: #f5f5f5;
}

.google-btn i {
    margin-right: 10px;
    color: #4285f4;
}

/* User menu styles */
.user-menu {
    position: relative;
    margin-left: auto;
}

.user-avatar {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px;
    border-radius: 20px;
    transition:  0.3s;
    min-height: 32px;
    position: relative;
}

.user-avatar i {
    color: var(--branding-green);
}
.user-avatar:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--branding-dark-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.username {
    color: white;
    font-size: 14px;
}

.user-dropdown {
    position: absolute;

    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 150px;
    display: none;
    z-index: 1000;
    margin-top: 8px;
    border: 1px solid #eee;
}

.user-menu:hover .user-dropdown {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    color: var(--branding-dark-blue);
    text-decoration: none;
    transition: background-color 0.3s;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown-item i {
    font-size: 14px;
}

.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.view-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--branding-dark-blue);
    border: 1px solid var(--branding-dark-blue);
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: var(--branding-dark-blue);
    color: white;
}

.filter-btn.active {
    background-color: var(--branding-dark-blue);
    color: white;
}

.traffic-type {
    white-space: nowrap;
}

.traffic-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 12px;
    cursor: help;
}

.traffic-indicator.bot {
    background-color: #ffebee;
    color: #c62828;
}

.traffic-indicator.human {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.traffic-indicator i {
    font-size: 12px;
}

.campaign-stats {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    position: relative;
}

.campaign-stats h2 {
    margin-bottom: 20px;
    color: var(--branding-dark-blue);
    font-size: 1.5em;
}

.campaign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.campaign-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.campaign-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.campaign-card.active {
    border-color: var(--branding-green);
    background-color: #f8fff9;
}

.campaign-card h3 {
    color: var(--branding-dark-blue);
    font-size: 1.1em;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.campaign-metrics {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.metric {
    text-align: center;
}

.metric-value {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
    color: var(--branding-green);
}

.metric-label {
    font-size: 0.8em;
    color: #666;
}

/* Add a clear filter button when a campaign is selected */
.clear-filter {
    position: absolute;
    right: 20px;
    top: 20px;
    padding: 8px 16px;
    border-radius: 4px;
    background-color: var(--branding-dark-blue);
    color: white;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s;
}

.clear-filter:hover {
    opacity: 0.9;
}

.campaign-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.campaign-header h2 {
    margin-bottom: 0;
}

.toggle-campaigns {
    padding: 8px 16px;
    border-radius: 4px;
    background: transparent;
    color: var(--branding-dark-blue);
    border: 1px solid var(--branding-dark-blue);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.toggle-campaigns:hover {
    background-color: var(--branding-dark-blue);
    color: white;
}

.toggle-campaigns i {
    transition: transform 0.3s ease;
}

.campaign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    transition: max-height 0.5s ease;
}

.campaign-grid.collapsed {
    max-height: 320px; /* Approximately 2 rows */
    overflow: hidden;
}

.campaign-grid.expanded {
    max-height: 2000px; /* Large enough to show all */
}

/* Toggle button states */
.toggle-campaigns .hide-text {
    display: none;
}

.toggle-campaigns.active {
    background-color: var(--branding-dark-blue);
    color: white;
}

.toggle-campaigns.active .show-text {
    display: none;
}

.toggle-campaigns.active .hide-text {
    display: inline;
}

.toggle-campaigns.active i {
    transform: rotate(180deg);
}

.visits-graph-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.graph-header h2 {
    color: var(--branding-dark-blue);
    font-size: 1.5em;
    margin: 0;
}

.graph-controls select {
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid var(--branding-dark-blue);
    color: var(--branding-dark-blue);
    background: white;
    cursor: pointer;
}

.graph-wrapper {
    background: white;
    padding: 20px;
    border-radius: 8px;
    height: 400px;
}

/* Add tooltip styles for spike indicators */
.spike-tooltip {
    background: rgba(5, 17, 38, 0.9) !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
    color: white !important;
    font-size: 12px !important;
}

.details-content .visits-graph-container {
    margin: 0 0 20px 0;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.details-content .graph-wrapper {
    height: 300px;
}

.details-content .graph-header {
    margin-bottom: 15px;
}

.details-content .graph-header h2 {
    font-size: 1.2em;
}

.table-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 20px;
}

.table-controls .inputs-wrapper {
    flex: 1;
    margin: 0;
}

.table-controls .form-sort {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.table-controls select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--branding-dark-blue);
    color: var(--branding-dark-blue);
    background: white;
}

.btn-download {
    background: var(--branding-dark-blue);
    color: white;
    border: 1px solid var(--branding-dark-blue);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    min-width: 60px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: opacity 0.3s ease;
}

.btn-download:hover {
    opacity: 0.9;
}

.btn-download i {
    font-size: 11px;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.modal-content h3 {
    color: var(--branding-dark-blue);
    margin-bottom: 15px;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.btn-cancel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: var(--branding-dark-blue);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-cancel:hover {
    background: #e9ecef;
}

.btn-confirm {
    background: #dc3545;
    border: 1px solid #dc3545;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-confirm:hover {
    opacity: 0.9;
}

/* Add animation */
.modal.show {
    display: flex;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
}

.checkbox-wrapper input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-wrapper label {
    color: var(--branding-dark-blue);
    font-size: 14px;
}

.url-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.url-type.private {
    background-color: #fee2e2;
    color: #991b1b;
}

.url-type.public {
    background-color: #dcfce7;
    color: #166534;
}

.url-type i {
    font-size: 11px;
}

.type-cell {
    text-align: center;
}

.btn-privacy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-privacy.private {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.btn-privacy.public {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.btn-privacy:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.btn-privacy:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-privacy i {
    font-size: 11px;
}

.admin-btn {
    background: var(--branding-dark-blue);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s;
}

.admin-btn:hover {
    opacity: 0.9;
    color: white;
}

.admin-btn i {
    font-size: 14px;
}

.admin-btn.view-sitemap {
    background: var(--branding-green);
}

.admin-btn.view-sitemap:hover {
    opacity: 0.9;
    color: white;
}

.admin-section-title {
    color: var(--branding-dark-blue);
    font-size: 1.2em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--branding-green);
}