/* WordPress Wrapper for Theme Compatibility */
.focuswheel-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    margin: 1.25rem 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Focus Wheel Plugin Styles */
.focuswheel-container {
    max-width: none !important;
    width: 100% !important;
    min-width: 100% !important;
    margin: 0 auto;
    padding: 2rem !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    border-radius: 1rem;
    box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.1);
    box-sizing: border-box !important;
    overflow: visible !important;
}

/* Ensure the container takes full available width in WordPress */
.focuswheel-container * {
    box-sizing: border-box !important;
}

/* Layout Structure */
.focuswheel-layout {
    display: flex !important;
    gap: 50px !important;
    margin-top: 30px !important;
    align-items: flex-start !important;
    width: 100% !important;
    min-width: 800px !important;
}

/* Sidebar for Saved Wheels */
.focuswheel-sidebar {
    flex: 0 0 280px !important;
    background: white !important;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgb55a(0, 0, 0, 0.08);
    overflow: hidden;
    min-height: 500px !important;
    width: 280px !important;
    max-width: 280px !important;
    display: flex;
    flex-direction: column;
}

.focuswheel-sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.focuswheel-sidebar-header h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
}

.focuswheel-search-container {
    position: relative;
}

.focuswheel-search {
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    outline: none;
    transition: background 0.3s ease;
}

.focuswheel-search:focus {
    background: white;
}

.focuswheel-search::placeholder {
    color: #666;
}

/* Wheels List */
.focuswheel-wheels-list {
    max-height: 500px;
    overflow-y: auto;
    padding: 10px 0;
    /* Allow list to fill available space */
    flex: 1;
    display: flex;
    flex-direction: column;
}

.focuswheel-wheel-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.focuswheel-wheel-item:hover {
    background: #f8f9ff;
    transform: translateX(5px);
}

.focuswheel-wheel-item.active {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-left: 4px solid #667eea;
}

.focuswheel-wheel-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 14px;
}

.focuswheel-wheel-preview {
    font-size: 12px;
    color: #666;
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.focuswheel-wheel-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #999;
}

.focuswheel-wheel-date {
    font-style: italic;
}

.focuswheel-wheel-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.focuswheel-wheel-item:hover .focuswheel-wheel-actions {
    opacity: 1;
}

.focuswheel-wheel-action {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.focuswheel-wheel-action.edit {
    background: #e3f2fd;
    color: #1976d2;
}

.focuswheel-wheel-action.delete {
    background: #ffebee;
    color: #d32f2f;
}

.focuswheel-wheel-action:hover {
    transform: scale(1.1);
}

.focuswheel-no-wheels {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.focuswheel-no-wheels p {
    margin: 5px 0;
    font-size: 14px;
}

/* Main Content Area */
.focuswheel-content {
    flex: 1 !important;
    min-width: 400px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 0px !important;
    width: auto !important;
}

.focuswheel-main {
    width: 100% !important;
    max-width: 600px !important;
    margin-bottom: 30px !important;
    min-width: 400px !important;
}

.focuswheel-footer {
    width: 100% !important;
    max-width: 600px !important;
    min-width: 400px !important;
}

.focuswheel-header {
    text-align: center;
    margin-bottom: 30px;
}

.focuswheel-header h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
}

.focuswheel-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.focuswheel-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.focuswheel-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.focuswheel-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.focuswheel-btn-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.focuswheel-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.focuswheel-btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.focuswheel-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.focuswheel-btn-secondary {
    background: #6c757d;
    color: white;
}

.focuswheel-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.focuswheel-select {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    background: white;
    font-size: 14px;
    min-width: 200px;
    outline: none;
    transition: border-color 0.3s ease;
}

.focuswheel-select:focus {
    border-color: #667eea;
}

.focuswheel-input {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    background: white;
    font-size: 14px;
    min-width: 200px;
    outline: none;
    transition: border-color 0.3s ease;
}

.focuswheel-input:focus {
    border-color: #667eea;
}

.focuswheel-main {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
}

.focuswheel-wheel {
    position: relative;
    width: 450px;
    height: 450px;
    margin: 0 auto;
}

.focuswheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.focuswheel-center:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.focuswheel-center-content {
    text-align: center;
    padding: 10px;
}

.focuswheel-center-text {
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
    display: block;
    word-wrap: break-word;
    hyphens: auto;
}

.focuswheel-segment {
    position: absolute;
    width: 135px;
    height: 80px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.focuswheel-segment:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    z-index: 5;
}

.focuswheel-segment-content {
    text-align: center;
    padding: 8px;
}

.focuswheel-segment-text {
    font-size: 10px;
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.2;
    display: block;
    word-wrap: break-word;
    hyphens: auto;
}

/* Spokes extending from center to segments */
.focuswheel-spoke {
    position: absolute;
    width: 2px;
    height: 120px;
    background: linear-gradient(to bottom, rgba(108, 117, 125, 0.3) 0%, rgba(108, 117, 125, 0.6) 50%, rgba(108, 117, 125, 0.3) 100%);
    top: 50%;
    left: 50%;
    transform-origin: center bottom;
    z-index: 1;
}

.focuswheel-spoke-1 {
    transform: translate(-50%, -100%) rotate(0deg);
}

.focuswheel-spoke-2 {
    transform: translate(-50%, -100%) rotate(30deg);
}

.focuswheel-spoke-3 {
    transform: translate(-50%, -100%) rotate(60deg);
}

.focuswheel-spoke-4 {
    transform: translate(-50%, -100%) rotate(90deg);
}

.focuswheel-spoke-5 {
    transform: translate(-50%, -100%) rotate(120deg);
}

.focuswheel-spoke-6 {
    transform: translate(-50%, -100%) rotate(150deg);
}

.focuswheel-spoke-7 {
    transform: translate(-50%, -100%) rotate(180deg);
}

.focuswheel-spoke-8 {
    transform: translate(-50%, -100%) rotate(210deg);
}

.focuswheel-spoke-9 {
    transform: translate(-50%, -100%) rotate(240deg);
}

.focuswheel-spoke-10 {
    transform: translate(-50%, -100%) rotate(270deg);
}

.focuswheel-spoke-11 {
    transform: translate(-50%, -100%) rotate(300deg);
}

.focuswheel-spoke-12 {
    transform: translate(-50%, -100%) rotate(330deg);
}

/* Position 12 segments around the circle using proportional positioning */
.focuswheel-segment-1 {
    top: 2.5%;
    left: 50%;
    transform: translateX(-50%);
}

.focuswheel-segment-2 {
    top: 6.25%;
    right: 8.75%;
}

.focuswheel-segment-3 {
    top: 21.25%;
    right: 2.5%;
}

.focuswheel-segment-4 {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

.focuswheel-segment-5 {
    bottom: 21.25%;
    right: 2.5%;
}

.focuswheel-segment-6 {
    bottom: 6.25%;
    right: 8.75%;
}

.focuswheel-segment-7 {
    bottom: 2.5%;
    left: 50%;
    transform: translateX(-50%);
}

.focuswheel-segment-8 {
    bottom: 6.25%;
    left: 8.75%;
}

.focuswheel-segment-9 {
    bottom: 21.25%;
    left: 2.5%;
}

.focuswheel-segment-10 {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.focuswheel-segment-11 {
    top: 21.25%;
    left: 2.5%;
}

.focuswheel-segment-12 {
    top: 6.25%;
    left: 8.75%;
}

.focuswheel-footer {
    text-align: center;
    margin-top: 30px;
}

.focuswheel-save-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.focuswheel-messages {
    min-height: 30px;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.focuswheel-messages.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.focuswheel-messages.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.focuswheel-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

/* Modal Styles */
.focuswheel-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.focuswheel-modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.focuswheel-modal-header {
    padding: 20px 25px 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.focuswheel-modal-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.focuswheel-modal-close {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #adb5bd;
    transition: color 0.3s ease;
}

.focuswheel-modal-close:hover {
    color: #6c757d;
}

.focuswheel-modal-body {
    padding: 25px;
}

.focuswheel-modal-body textarea {
    width: 100%;
    max-width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.focuswheel-modal-body textarea:focus {
    border-color: #667eea;
}

.focuswheel-modal-footer {
    padding: 15px 25px 25px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Responsive Design */
@media (max-width: 4000px) {
    .focuswheel-wrapper {
        overflow-x: visible !important;
    }
}

@media (max-width: 1200px) {
    .focuswheel-wrapper {
        overflow-x: visible !important;
    }

    .focuswheel-container {
        min-width: 100% !important;
        padding: 1.5rem !important;
    }

    .focuswheel-layout {
        gap: 2.5rem !important;
        min-width: 100% !important;
    }

    .focuswheel-sidebar {
        flex: 0 0 30% !important;
        width: 30% !important;
        max-width: 30% !important;
    }
}

@media (max-width: 1024px) {
    .focuswheel-wrapper {
        overflow-x: visible !important;
    }

    .focuswheel-container {
        min-width: auto !important;
        padding: 1.25rem !important;
    }

    .focuswheel-layout {
        flex-direction: column !important;
        gap: 2rem !important;
        min-width: auto !important;
    }

    .focuswheel-sidebar {
        flex: none !important;
        order: -1 !important;
        max-width: 100% !important;
        width: 100% !important;
        min-height: auto !important;
        height: auto !important;
        display: flex;
        flex-direction: column;
    }

    .focuswheel-content {
        padding: 0.625rem !important;
        min-width: auto !important;
    }

    .focuswheel-main {
        min-width: auto !important;
    }

    .focuswheel-footer {
        min-width: auto !important;
    }

    .focuswheel-wheels-list {
        max-height: 25rem;
    }

    .focuswheel-wheel-item {
        padding: 0.75rem 1.25rem;
    }
}

@media (max-width: 768px) {
    .focuswheel-container {
        padding: 1rem;
        margin: 0.625rem;
    }

    .focuswheel-layout {
        gap: 1rem;
    }

    .focuswheel-sidebar {
        border-radius: 0.5rem;
    }

    .focuswheel-sidebar-header {
        padding: 1rem;
    }

    .focuswheel-sidebar-header h4 {
        font-size: 1rem;
        margin-bottom: 0.625rem;
    }

    .focuswheel-wheels-list {
        /* On mobile, make the list fill available space in sidebar */
        max-height: calc(100vh - 22rem);
        /* Adjust based on other elements */
        min-height: 15rem;
    }

    .focuswheel-wheel-item {
        padding: 0.625rem 1rem;
    }

    .focuswheel-wheel-name {
        font-size: 0.8125rem;
    }

    .focuswheel-wheel-preview {
        font-size: 0.6875rem;
        -webkit-line-clamp: 1;
    }

    .focuswheel-wheel {
        width: min(85vw, 37rem);
        height: min(85vw, 37rem);
    }

    .focuswheel-zoom-controls {
        gap: 0.4rem;
        padding: 0.2rem 0.5rem;
        margin-left: 0.75rem;
    }

    .focuswheel-zoom-btn {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.875rem;
    }

    .focuswheel-zoom-level {
        min-width: 2.5rem;
        font-size: 0.625rem;
    }

    .focuswheel-center {
        width: 26%;
        height: 26%;
    }

    .focuswheel-center-text {
        font-size: 0.625rem;
    }

    .focuswheel-segment {
        width: 30%;
        height: 20%;
    }

    .focuswheel-segment-text {
        font-size: 0.5625rem;
    }

    /* Scale spokes proportionally for 768px breakpoint */
    .focuswheel-spoke {
        height: 36%;
    }


    .focuswheel-controls {
        flex-direction: column;
        gap: 0.625rem;
    }

    .focuswheel-save-section {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.625rem;
        justify-content: center;
    }

    .focuswheel-zoom-controls {
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .focuswheel-input {
        min-width: 15rem;
    }
}

/* Mobile-specific height fixes for 540x720 and similar viewports */
@media (max-width: 600px) and (min-width: 481px) {
    .focuswheel-sidebar {
        min-height: auto !important;
        height: auto !important;
        max-height: calc(100vh - 200px);
        display: flex;
        flex-direction: column;
    }

    .focuswheel-sidebar-header {
        flex-shrink: 0;
    }

    .focuswheel-wheels-list {
        flex: 1 1 auto;
        min-height: 12rem;
        max-height: none !important;
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .focuswheel-container {
        padding: 0.625rem;
        margin: 0.3rem;
    }

    .focuswheel-layout {
        gap: 0.625rem;
    }

    .focuswheel-sidebar {
        min-height: auto !important;
    }

    .focuswheel-sidebar-header {
        padding: 0.75rem;
    }

    .focuswheel-sidebar-header h4 {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }

    .focuswheel-search {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .focuswheel-wheels-list {
        max-height: calc(100vh - 25rem);
        min-height: 9rem;
    }

    .focuswheel-wheel-item {
        padding: 0.5rem 0.75rem;
    }

    .focuswheel-wheel-name {
        font-size: 0.75rem;
    }

    .focuswheel-wheel-preview {
        font-size: 0.625rem;
    }

    .focuswheel-wheel-meta {
        font-size: 0.625rem;
    }

    .focuswheel-wheel {
        width: min(80vw, 15rem);
        height: min(80vw, 15rem);
    }

    .focuswheel-zoom-controls {
        gap: 0.3rem;
        padding: 0.2rem 0.4rem;
        margin-left: 0;
    }

    .focuswheel-zoom-btn {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.75rem;
    }

    .focuswheel-zoom-level {
        min-width: 2rem;
        font-size: 0.5625rem;
    }

    .focuswheel-save-section {
        flex-direction: column;
        align-items: center;
    }

    .focuswheel-zoom-controls {
        width: auto;
        margin-top: 0.5rem;
    }

    .focuswheel-center {
        width: 28%;
        height: 28%;
    }

    .focuswheel-center-text {
        font-size: 0.5rem;
    }

    .focuswheel-segment {
        width: 24%;
        height: 16%;
    }

    .focuswheel-segment-text {
        font-size: 0.4375rem;
    }


    /* Scale spokes proportionally for 480px breakpoint */
    .focuswheel-spoke {
        height: 35%;
    }

    .focuswheel-modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .focuswheel-input {
        min-width: 12rem;
    }
}

/* Scrollbar Styling for Wheels List */
.focuswheel-wheels-list::-webkit-scrollbar {
    width: 6px;
}

.focuswheel-wheels-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.focuswheel-wheels-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.focuswheel-wheels-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Loading State */
.focuswheel-wheels-list.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.focuswheel-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Search Highlight */
.focuswheel-wheel-item.highlight {
    background: #fff3cd;
    border-left: 0.25rem solid #ffc107;
}

.focuswheel-wheel-item.highlight .focuswheel-wheel-name {
    color: #856404;
}

.focuswheel-container {
    min-width: auto !important;
    padding: 0 !important;
}

@media (max-width: 480px) {
    .focuswheel-segment {
        width: 28%;
        height: 20%;
    }

    .focuswheel-content {
        padding: 0 !important;
        width: 100% !important;
    }

    .focuswheel-wheel {
        width: min(75vw, 18rem);
        height: min(75vw, 18rem);
    }

}

.focuswheel-sidebar {
    text-align: left;
}

.focuswheel-layout {
    text-align: center;
}