/**
 * Feedback Form Widget Styles for ThingRex.com
 */

#trex-feedback-widget {
    position: fixed;
    width: 350px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    z-index: 9999;
    overflow: hidden;
    transition: all 0.3s ease;
    /* Position is now set dynamically via JavaScript */
    display: flex;
    flex-direction: column;
}

#trex-feedback-widget.minimized {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
}

#trex-feedback-widget.expanded {
    width: 100%;
    height: 100%;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    animation: expandTwoStep 0.5s ease;
}

@keyframes expandTwoStep {
    0% {
        width: 350px;
        height: auto;
        top: auto;
        left: auto;
        right: 20px;
        bottom: 20px;
        border-radius: 8px;
    }
    50% {
        width: 80%;
        height: 80%;
        top: 10%;
        right: 10%;
        bottom: 10%;
        left: auto;
        border-radius: 4px;
    }
    100% {
        width: 100%;
        height: 100%;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        border-radius: 0;
    }
}

#trex-feedback-widget.expanded .trex-widget-content {
    flex: 1;
    max-height: none;
    overflow-y: auto;
}

.trex-widget-title {
    background-color: #2c3e50;
    color: white;
    padding: 10px 15px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trex-widget-title-text {
    display: block;
}

.trex-widget-title-minimized {
    display: none;
    font-size: 20px;
    font-weight: bold;
}

#trex-feedback-widget.minimized .trex-widget-title-text {
    display: none;
}

#trex-feedback-widget.minimized .trex-widget-title-minimized {
    display: block;
}

#trex-feedback-widget.minimized .trex-widget-title {
    padding: 0;
    height: 50px;
    width: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

#trex-feedback-widget.minimized .trex-widget-controls {
    display: none;
}

.trex-widget-controls {
    display: flex;
    gap: 5px;
}

.trex-widget-controls button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 0 5px;
}

.trex-widget-controls button:hover {
    color: #ddd;
}

.trex-widget-content {
    padding: 15px 20px 15px 15px;
    max-height: 500px;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.trex-widget-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

#trex-feedback-widget.minimized .trex-widget-content {
    display: none;
}

.trex-form-group {
    margin-bottom: 15px;
}

.trex-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.trex-form-group input,
.trex-form-group select,
.trex-form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
}

.trex-form-group textarea {
    resize: vertical;
}

.trex-submit-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
    width: 100%; /* Make button full width */
}

.trex-submit-btn:hover {
    background-color: #2980b9;
}

.trex-powered-by {
    text-align: center;
    margin-top: 10px;
    font-size: 11px;
    color: #999;
}

.trex-powered-by a {
    color: #777;
    text-decoration: none;
    transition: color 0.2s;
}

.trex-powered-by a:hover {
    color: #3498db;
    text-decoration: underline;
}

.trex-form-response {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
}

.trex-form-response .success {
    color: #27ae60;
    background-color: #e8f8f5;
    padding: 10px;
    border-radius: 4px;
}

.trex-form-response .error {
    color: #c0392b;
    background-color: #fadbd8;
    padding: 10px;
    border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    #trex-feedback-widget {
        width: 300px;
    }
    
    #trex-feedback-widget.expanded {
        width: 100%;
    }
}
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}
#trex-feedback-form {
    display: flex;
    flex-direction: column;
    height: 100%;
}
#trex-feedback-widget.expanded .trex-form-group:nth-last-child(2) {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#trex-feedback-widget.expanded .trex-form-group:nth-last-child(2) textarea {
    flex: 1;
    height: 100%;
    min-height: 200px;
}
.trex-char-counter {
    text-align: right;
    font-size: 0.8em;
    color: #666;
    margin-top: 2px;
}

.trex-char-counter.limit-warning {
    color: #ff6600;
}

.trex-char-counter.limit-reached {
    color: #cc0000;
    font-weight: bold;
}
