/* ================================================
   SQL/PTT Configuration Panel Stylesheet
   Author: SP2ONG
   Style: Modern, Responsive, Animated
   ================================================ */

/* === Container === */
.sqlptt-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    animation: fadeIn 0.5s ease-in;
}

/* === Header === */
.sqlptt-header {
    text-align: center;
    margin-bottom: 30px;
}

.sqlptt-title {
    font-family: 'Oswald', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #00aee8;
    text-shadow: 0.5px 0.5px 2px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 0 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, rgba(0, 174, 232, 0.1) 0%, rgba(8, 220, 110, 0.1) 100%);
    border-radius: 12px;
    border: 2px solid rgba(0, 174, 232, 0.3);
    transition: all 0.3s ease;
}

.sqlptt-title:hover {
    border-color: #00aee8;
    box-shadow: 0 4px 15px rgba(0, 174, 232, 0.3);
    transform: translateY(-2px);
}

.sqlptt-title .material-icons {
    font-size: 32px;
    color: #08dc6e;
    animation: pulse 2s ease-in-out infinite;
}

/* === Schematic Links === */
.schematic-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.schematic-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(0, 174, 232, 0.15);
    border: 2px solid #00aee8;
    border-radius: 8px;
    color: #00aee8;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.schematic-link:hover {
    background: rgba(0, 174, 232, 0.3);
    border-color: #08dc6e;
    color: #08dc6e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 174, 232, 0.3);
}

.schematic-link .material-icons {
    font-size: 20px;
}

/* === C-Media Status === */
.cmedia-status {
    background: linear-gradient(135deg, rgba(0, 174, 232, 0.1) 0%, rgba(8, 220, 110, 0.1) 100%);
    border: 2px solid #00aee8;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
    animation: slideDown 0.4s ease-out;
}

.status-header {
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #f3ead3;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.status-header .material-icons {
    font-size: 24px;
    color: #00aee8;
}

.status-header strong {
    color: #00ffff;
}

.status-indicator {
    display: flex;
    justify-content: center;
}

.status-btn {
    padding: 12px 30px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: default;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.status-btn .material-icons {
    font-size: 22px;
}

.status-ok {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
}

.status-error {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: white;
}

/* === C-Media Warning === */
.cmedia-warning {
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.15) 0%, rgba(204, 0, 0, 0.15) 100%);
    border: 2px solid #ff4444;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    animation: shake 0.5s ease-in-out;
}

.warning-icon .material-icons {
    font-size: 48px;
    color: #ff4444;
}

.cmedia-warning p {
    color: #ff6666;
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

/* === Console Output === */
.sqlptt-console {
    background: #1a1a1a;
    border: 2px solid #00aee8;
    border-radius: 12px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 174, 232, 0.2);
    animation: slideDown 0.4s ease-out;
}

.console-header {
    background: linear-gradient(135deg, #00aee8 0%, #0088bb 100%);
    color: white;
    padding: 12px 20px;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.console-header .material-icons {
    font-size: 20px;
}

.console-output {
    background: #000;
    padding: 15px 20px;
    min-height: 60px;
    max-height: 120px;
    overflow-y: auto;
}

.console-output pre {
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: bold;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
}

.console-output::-webkit-scrollbar {
    width: 8px;
}

.console-output::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.console-output::-webkit-scrollbar-thumb {
    background: #00aee8;
    border-radius: 4px;
}

.console-output::-webkit-scrollbar-thumb:hover {
    background: #08dc6e;
}

/* === Form Section === */
.sqlptt-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 2px solid rgba(0, 174, 232, 0.3);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: slideUp 0.5s ease-out;
}

.sqlptt-section:hover {
    border-color: #00aee8;
    box-shadow: 0 6px 20px rgba(0, 174, 232, 0.25);
}

.section-header {
    background: linear-gradient(135deg, #00aee8 0%, #0088bb 100%);
    color: white;
    padding: 15px 20px;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 0.5px;
}

.section-header .material-icons {
    font-size: 24px;
}

.section-content {
    padding: 25px;
    background: rgba(0, 0, 0, 0.3);
}

/* === Config Grid === */
.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.config-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* === Form Elements === */
.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: #f3ead3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.form-group label .material-icons {
    font-size: 20px;
    color: #08dc6e;
}

.input-text {
    width: 100%;
    padding: 12px 15px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid rgba(0, 174, 232, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.input-text:focus {
    border-color: #00aee8;
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 0 3px rgba(0, 174, 232, 0.2);
}

.input-text:hover {
    border-color: #08dc6e;
}

/* === Info Box === */
.info-box {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.15) 0%, rgba(3, 169, 244, 0.15) 100%);
    border: 2px solid #2196f3;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    gap: 15px;
}

.info-box .material-icons {
    font-size: 28px;
    color: #2196f3;
    flex-shrink: 0;
}

.info-text {
    color: #f3ead3;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.7;
}

.info-text p {
    margin: 8px 0;
}

.info-text strong {
    color: #00ffff;
    font-weight: 700;
}

.error-text {
    color: #ff4444;
    font-weight: 700;
}

/* === Diagram Column === */
.diagram-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top:30px;
}

.diagram-card {
    background: rgba(225, 225, 225, 0.95);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.diagram-card h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #000;
    margin: 0 0 15px 0;
}

.diagram-img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.diagram-img.clickable {
    cursor: pointer;
}

.diagram-img.clickable:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.diagram-note {
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #000;
    margin: 5px 0 0 0;
}

/* === Buttons === */
.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.btn {
    padding: 16px 40px;
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn .material-icons {
    font-size: 22px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.btn-save {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: white;
}

.btn-save:hover {
    background: linear-gradient(135deg, #ff6666 0%, #ff0000 100%);
}

/* ✅ Blokuj ponowne kliknięcia przez CSS, nie disabled */
.btn-saving {
    pointer-events: none !important;
    cursor: wait !important;
    opacity: 0.8 !important;
    background: linear-gradient(135deg, #ff9800 0%, #e68900 100%) !important;
}

/* === Access Denied === */
.access-denied {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.access-denied img {
    max-width: 300px;
    opacity: 0.8;
    animation: float 3s ease-in-out infinite;
}

.access-denied-text {
    color: #f3ead3;
    font-size: 18px;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    margin-top: 30px;
}

/* === Animations === */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes spinning {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinning {
    animation: spinning 1s linear infinite;
}

/* === Responsive Design === */
@media screen and (max-width: 1024px) {
    .config-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 768px) {
    .sqlptt-container {
        padding: 10px;
    }
    
    .sqlptt-title {
        font-size: 18px;
        flex-direction: column;
        gap: 8px;
    }
    
    .sqlptt-title .material-icons {
        font-size: 28px;
    }
    
    .schematic-links {
        flex-direction: column;
    }
    
    .schematic-link {
        justify-content: center;
    }
    
    .section-header {
        font-size: 12px;
        padding: 12px 15px;
    }
    
    .section-content {
        padding: 15px;
    }
    
    .console-output pre {
        font-size: 11px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .info-box {
        flex-direction: column;
        text-align: center;
    }
}

@media screen and (max-width: 480px) {
    .sqlptt-title {
        font-size: 16px;
    }
    
    .form-group label {
        font-size: 11px;
    }
    
    .input-text {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .btn {
        font-size: 13px;
        padding: 14px 30px;
    }
    
    .cmedia-warning {
        flex-direction: column;
        text-align: center;
    }
}
