/* public/styles/keyGen.css */

/* Base styles */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Special Elite', monospace;
    background: url('/images/mainBackground.png') no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    color: #ffffff;
}

/* Container styles */
.keyGenerator {
    width: 90%;
    max-width: 600px;
    margin: 80px auto 0;
    padding: 20px;
    min-height: calc(100vh - 75px);
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Header styles */
.keyGenerator h2,
.keyGenerator h3 {
    text-align: center;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    color: #4CAF50;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.keyGenerator h3 {
    font-size: 1.2rem;
}

/* Form styles */
form#keyGeneratorForm {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.formGroup {
    display: flex;
    flex-direction: column;
}

.formGroup label {
    font-size: 0.875rem;
    color: #90EE90;
    margin-bottom: 0.5rem;
}

.formGroup input,
.formGroup select {
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    color: #ffffff;
    font-family: 'Special Elite', monospace;
    font-size: 0.875rem;
}

.formGroup select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23ffffff" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.formGroup input:focus,
.formGroup select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

/* Button styles */
.generateButton,
.copyButton,
.copyTableButton,
.deleteButton {
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    font-family: 'Special Elite', monospace;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.3s;
}

.generateButton {
    background: #4CAF50;
    color: #ffffff;
}

.generateButton:hover {
    background: #45a049;
}

.generateButton:disabled {
    background: rgba(76, 175, 80, 0.5);
    cursor: not-allowed;
}

.copyButton,
.copyTableButton {
    background: #1976D2;
    color: #ffffff;
    margin: 0 0.5rem;
}

.copyButton:hover,
.copyTableButton:hover {
    background: #1565C0;
}

.copyButton.copied,
.copyTableButton.copied {
    background: #42A5F5;
}

.deleteButton {
    background: #ff6b6b;
}

.deleteButton:hover {
    background: #d32f2f;
}

/* Error message */
.error {
    text-align: center;
    padding: 1rem;
    color: #ff6b6b;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 8px;
    margin: 1rem 0;
    font-size: 0.875rem;
}

/* Key display section */
.keyDisplaySection {
    margin-top: 1.5rem;
}

.keyDisplay {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem;
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.875rem;
    color: #ffffff;
    overflow-x: auto;
}

/* Keys list section */
.keysListSection {
    margin-top: 2rem;
}

.table-container {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    overflow-x: auto;
    margin-top: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
}

.keys-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 320px;
}

.keys-table th {
    background: rgba(76, 175, 80, 0.2);
    color: #90EE90;
    text-align: left;
    padding: 0.75rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.keys-table td {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
}

/* Column specific styles */
.col-key { min-width: 100px; }
.col-domain { min-width: 150px; }
.col-widget { min-width: 120px; }
.col-created { min-width: 150px; }
.col-expires { min-width: 150px; }
.col-action { min-width: 200px; } /* Increased to accommodate two buttons */

/* Row hover effect */
@media (hover: hover) {
    .keys-table tr:hover td {
        background: rgba(0, 0, 0, 0.3);
    }
}

/* Empty state */
.no-keys {
    text-align: center;
    padding: 2rem;
    color: #90EE90;
    font-style: italic;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin: 1rem 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #45a049;
}

/* Tablet Responsive adjustments */
@media (max-width: 768px) {
    .keyGenerator {
        width: 95%;
        margin-top: 60px;
        padding: 15px;
        min-height: calc(100vh - 60px);
    }

    .keyGenerator h2,
    .keyGenerator h3 {
        font-size: 1.6rem;
    }

    .keyGenerator h3 {
        font-size: 1.2rem;
    }

    .formGroup label,
    .formGroup input,
    .formGroup select,
    .generateButton,
    .copyButton,
    .copyTableButton,
    .deleteButton,
    .error,
    .keyDisplay,
    .keys-table {
        font-size: 0.8rem;
    }

    .formGroup input,
    .formGroup select,
    .generateButton,
    .copyButton,
    .copyTableButton,
    .deleteButton {
        padding: 0.6rem;
    }

    .keyDisplay,
    .table-container {
        max-height: 150px;
        overflow-y: auto;
    }

    .col-key { min-width: 80px; }
    .col-domain { min-width: 120px; }
    .col-widget { min-width: 100px; }
    .col-created { min-width: 120px; }
    .col-expires { min-width: 120px; }
    .col-action { min-width: 160px; }
}

/* Mobile Responsive adjustments */
@media (max-width: 480px) {
    .keyGenerator {
        width: 100%;
        margin-top: 75px;
        padding: 10px;
        min-height: calc(100vh - 50px);
    }

    .keyGenerator h2 {
        font-size: 1.4rem;
        padding: 0 10px;
    }

    .keyGenerator h3 {
        font-size: 1.1rem;
    }

    .formGroup label,
    .formGroup input,
    .formGroup select,
    .generateButton,
    .copyButton,
    .copyTableButton,
    .deleteButton,
    .error,
    .keyDisplay,
    .keys-table {
        font-size: 0.8rem;
    }

    .formGroup input,
    .formGroup select,
    .generateButton,
    .copyButton,
    .copyTableButton,
    .deleteButton {
        padding: 0.6rem;
    }

    .keyDisplay {
        padding: 0.6rem;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 4px;
        word-break: break-word;
        overflow-x: hidden;
    }

    .table-container {
        margin: 0;
        padding: 10px;
        overflow-x: hidden;
        border-radius: 8px;
    }

    .keys-table {
        display: block;
        width: 100%;
        min-width: unset;
    }

    .keys-table thead {
        display: none;
    }

    .keys-table tr {
        display: block;
        margin-bottom: 15px;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 8px;
        padding: 10px;
    }

    .keys-table td {
        display: flex;
        flex-direction: column;
        padding: 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .keys-table td:last-child {
        border-bottom: none;
    }

    .keys-table td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #90EE90;
        margin-bottom: 5px;
        font-size: 0.8rem;
    }

    .keys-table td > * {
        width: 100%;
        margin-left: 0;
    }

    .col-key,
    .col-domain,
    .col-widget,
    .col-created,
    .col-expires,
    .col-action {
        min-width: unset;
        width: 100%;
    }

    .col-action {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
    }
}