/* Project Creation Page Styles */
.project-creation-container {
    margin: 0;
    padding: 0;
    height: calc(100vh - 4rem); /* Account for main's padding */
    display: flex;
    flex-direction: column;
}

.project-header {
    text-align: left;
    margin-bottom: 20px;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.home-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.project-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.project-header h1 .step-text {
    color: #666;
    font-weight: normal;
}

.step-indicator {
    display: flex;
    gap: 1rem;
    margin: 0;
    align-items: center;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ddd;
    transition: background-color 0.3s;
}

.step-dot.active {
    background-color: #007bff;
}

.step h2 {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 2rem;
}

.project-creation-content {
    margin: 2rem 0;
}

.input-wrapper {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.project-name-input {
    width: 100%;
    padding: 1rem;
    padding-right: 3rem;
    font-size: 1.5rem;
    border: none;
    border-bottom: 2px solid #ddd;
    background: transparent;
    text-align: center;
    transition: border-color 0.3s;
    line-height: 1.5;
    height: 3.5rem;
}

.project-name-input:focus {
    outline: none;
    border-color: #007bff;
}

.input-icon {
    position: absolute;
    right: 1rem;
    top: 35%;
    transform: translateY(-50%);
    color: #666;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    width: 24px;
    pointer-events: none;
}

.input-tooltip {
    display: block;
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.project-creation-footer {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.cancel-btn {
    padding: 0.5rem 1rem;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
    min-width: 100px;
}

.cancel-btn:hover {
    background-color: #5a6268;
}

.next-btn {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s;
    min-width: 120px;
}

.next-btn:hover:not(:disabled) {
    background: #357abd;
}

.next-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Specific styles for the Done button in step 4 */
.government-builder .next-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    min-width: auto; /* Override min-width for the Done button */
}

/* Select input styles */
select.project-name-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
    height: 4rem;
    padding-top: 0;
    padding-bottom: 0;
    display: flex;
    align-items: center;
}

select.project-name-input:focus {
    outline: none;
    border-color: #007bff;
}

select.project-name-input option {
    padding: 0.5rem;
    line-height: 1.5;
}

.step {
    width: 100%;
    transition: transform 0.5s ease-out;
}

.arrow-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.arrow-btn:hover {
    color: #007bff;
}

.arrow-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.tags-container {
    position: relative;
    width: 100%;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    background-color: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.tag-remove {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag-remove:hover {
    color: #dc3545;
}

.header-content {
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
} 

/* Common container styles */
main {
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Government selection grid styles */
.government-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.government-option {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
}

.government-option::before {
    content: '';
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    width: 20px;
    height: 20px;
    border: 2px solid #666;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.government-option::after {
    content: '';
    position: absolute;
    top: 1.35rem;
    left: 1.35rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.government-option:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.government-option.selected {
    border-color: #007bff;
    background-color: #f0f7ff;
}

.government-option.selected::after {
    transform: scale(0.6);
}

.government-option h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.2rem;
    padding-left: 2rem;
}

.government-option p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    padding-left: 2rem;
}

/* Custom government placeholder */
.custom-government-placeholder {
    width: calc(100vw - 80px);
    height: calc(100vh - 180px);
    background-color: #f0f0f0;
    border-radius: 8px;
    margin: 0 auto;
    position: relative;
}

/* Custom government step specific styles */
#step4 {
    display: flex;
    flex-direction: column;
    padding: 0;  /* Remove padding to allow full container size */
    height: 100%;
}

.government-builder {
    position: relative;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    border-radius: 16px;
    border: 2px solid #e0e0e0;
    overflow: hidden;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1000;
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.menu-category {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.menu-category:last-child {
    border-bottom: none;
}

.menu-header {
    padding: 8px 16px;
    font-weight: 600;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
}

.menu-items {
    padding: 4px 0;
}

.menu-item {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s;
}

.menu-item:hover {
    background: #f5f5f5;
}

#gridCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
    cursor: grab;
}

#gridCanvas:active {
    cursor: grabbing;
}

#step4 .next-btn {
    background-color: #007bff;
    color: white;
    padding: 8px 24px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#step4 .next-btn:hover {
    background-color: #0056b3;
}

.add-step-select {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    padding: 8px 12px;
    font-size: 14px;
    color: #333;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    min-width: 160px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
}

.add-step-select:hover {
    border-color: #4a90e2;
}

.add-step-select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.add-step-select option {
    padding: 8px;
}

.add-step-select optgroup {
    font-weight: 600;
    color: #666;
}

/* Canvas Container Styles */
.canvas-container {
    position: relative;
    width: 100%;
    height: 100%;  /* Changed from calc(100vh - 200px) to 100% */
    overflow: hidden;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.canvas-content {
    /* Grid control variables – updated dynamically from JS */
    --grid-line-width: 1px;
    --grid-size: 50px;
    --grid-line-width-large: 1px;
    --grid-size-large: 500px;

    position: absolute;
    width: 10000px;
    height: 10000px;
    transform-origin: 0 0;
    left: 0;
    top: 0;
    margin: 0;
    transform: translate(0, 0) scale(1);
    background: #f0f0f0;
    /* Base grid */
    background-image: 
        linear-gradient(to right, rgba(180, 180, 180, 0.7) var(--grid-line-width), transparent var(--grid-line-width)),
        linear-gradient(to bottom, rgba(180, 180, 180, 0.7) var(--grid-line-width), transparent var(--grid-line-width));
    background-size: var(--grid-size) var(--grid-size);
    background-position: 0 0;
}

.canvas-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(to right, rgba(180, 180, 180, 0.9) var(--grid-line-width-large), transparent var(--grid-line-width-large)),
        linear-gradient(to bottom, rgba(180, 180, 180, 0.9) var(--grid-line-width-large), transparent var(--grid-line-width-large));
    background-size: var(--grid-size-large) var(--grid-size-large);
    background-position: 0 0;
    pointer-events: none;
}

.canvas-element {
    position: absolute;
    cursor: move;
    user-select: none;
    z-index: 1;
}

.canvas-element.dragging {
    opacity: 0.8;
    z-index: 1000;
}

/* Rule Node Styles */
.rule-node {
    font-family: Arial, sans-serif;
    width: 280px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    padding: 10px;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

.rule-header {
    position: relative;
    height: 24px;
    margin-bottom: 5px;
    background: #f8f8f8;
    border-radius: 4px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #999;
    font-size: 12px;
}

.rule-label {
    text-align: left;
    flex: 1;
}

.drag-icon {
    width: 24px;
    height: 16px;
    transform: rotate(90deg);
    position: absolute;
    left: 50%;
    transform: translateX(-50%) rotate(90deg);
}

.help-icon {
    margin-left: auto;
}

.rule-body {
    background-color: #9EC5FF;
    border-radius: 10px;
    padding: 15px 10px;
    color: #000;
    text-align: center;
    margin-bottom: 10px;
}

.rule-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dropdown-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
}

.group-select {
    flex: 1;
    padding: 6px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    background-color: rgb(124, 184, 124);
}

.delete-icon {
    cursor: pointer;
    margin-right: 8px;
    margin-left: 8px;
}

.add-group {
    font-size: 14px;
    color: #999;
    cursor: pointer;
    text-align: left;
    padding: 4px;
}

.icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

#step4 .project-creation-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;  /* Remove padding to allow full container size */
}
